Postcode Plus for DOS
PCP-DOS Command-Line Address Lookup
PCP-DOS is a powerful and versatile addressing program that can look up postcodes or use an organisation name, street, locality or town to find an address. A wide range of command-line parameters allow you to modify calls to the program exactly as you require them.
Setting up PCP-DOS
PCP-DOS operates as a command-line driven program. Parameters allow you to pass a request to PCP-DOS and tell it the format and location of the answer. PCP-DOS places the results of its request in a text or program file - which can either be opened and read by the application calling it, or run as a program by the calling application.
Parameters
Usage is: PCP-DOS [opt] addr
Where addr is a comma seperated list of address fields
[opt] specifies option switches defined as follows:
| -m | Show only the matching address records (default selection) |
| -a | Show all of the records returned by a search |
| -s | The search returns only the first matching postcode in any sector |
| -f | The returned information is stored in the file PCPLUS.TXT |
| -fFSPEC | The returned information is stored in the file FSPEC |
| -dFSPEC | fspec specifies pcplus data directory (default c:\pcplus) |
| -wfspec | fspec specifies windows dir (default c:\winnt or c:\windows) |
| -nNNN | NNN specifies max no. of address records to return (default 200) |
The command line to initiate a search for the address record based on postcode (B70 8AQ), writing this information to the default file PCPlus.TXT is:-
PCP-DOS -f B708AQ
Each record written to the output file is in the style of a single letter, followed by the main record information, followed by a new line character.
This format is explained below, as is a table highlighting the different letters found in the address record output.
Editing the PCPlus.TXT file will provide the following data:
p0462B70 8AQ
High Street
West Bromwich
0West Midlands
W Midlands 504520121
4004029120
CSGAWest Bromwich Central
QEESandwell
Y07West Midlands
| 15 | |||
| a0260 | Hill House Hammond | 260 | 1J1 |
| a0260 | Connell Estate Agents | 262 | 1B1 |
| a0260 | St. Michaels Presbytery | 266 | 1D1 |
| a0260 | Co-Operative Bank PLC | 266 | 1E1 |
| a0260 | Corals | 268 | 1F1 |
| a0260 | Setsquare Creative Design Consultants | 272 | 1G1 |
| a0260 | Setsquare Creative | 278 | 1H1 |
| a0260 | Walmsley Furniture PLC | 278 Flat | |
| a0260 | La Casa Restaurant | 280 | |
| a0260 | West End Cafe | 286 | |
| a0260 | 288 | ||
| a0260 | A C Communications | 312 | |
| a0260 | |||
| a0260 | |||
| a0260 | Baker News | ||
| f |
Examining the returned information line by line will provide you with a better understanding:
p0462BD7 1AB
Southbrook Terrace
Bradford
0West Yorkshire
3075201274
4159043280
CXGDUniversity
QDDBradford
Y
01
Northern and Yorkshire
7
| p0462BD7 1AB | The letter 'p' at the beginning of a record informs you that the record contains a postcode. 0462 is the variable length indicator (VLI) , which tells you the length of record. BD7 1AB is the postcode. |
| Southbrook Terrace | Displays the street information for the postcode. |
| Bradford | Displays the town information for the postcode. |
| 0West Yorkshire | Displays a number and then the county information for the postcode. If this number is '0' then the county appears as it does in the Royal Mail PAF data. If the number is '1' then the county has been inserted by AFD or there is no county shown. |
| W Yorkshire | County Abbreviation where avaliable |
| 3075201274 | The first five numbers display the mail sort code, the remaining numbers are the STD (subscriber trunk dialing) code for the postcode. he STD codes are approximate and are not part of the Royal Mail PAF data, this information is manually inserted by AFD. |
| 4159043280 | Display grid reference location for the postcode. The first five numbers are the eastern grid co-ordinates, the remaining numbers depict the northern grid co-ordinates. |
| CXGDUniversity | Displays the ward code (the first four characters) and the name of the local NHS ward. |
| QDDBradford | Displays the local NHS code and the name of the local NHS authority. |
| Y01 Northern and Yorkshire | Displays the NHS region code and the region name. |
| 7 | Displays the number of delivery points (letterboxes) on that postcode. |
| a0260 | Acorn Video | 2 | 1B1 |
| a0260 | Oasis Hairdressers | 3 | 1D1 |
| a0260 | Wilkinson & Partners | 4 | 1E1 |
| f | 53 |
| a2060 | The letter 'a' lets you know that the record contains an address. 0260 is the VLI and tells you the length of the record. |
| 3 | Displays the property number for the street. |
| 1D1 | Displays the delivery point suffix for that property. |
Some addresses will contain organisation names. The address record for 3 Southbrook Terrace, Bradford, displays 'Oasis Hairdressers' preceding the street number. Information will only appear here if the address contains an organisation name.
| F | the letter 'f' indicates that the search finished at this point. |
There are a number of letters that appear at the beginning of each line of an address record. These letters are:-
| p | the following record contains a postcode |
| a | the following record contains an address |
| m | the following record matches the search parameter |
| f | the search finished at this point |
| q | the search has returned the maximum number of addresses specified by the nNNN option |
E followed by a number an error value where:
| 1 | invalid postcode |
| 2 | postcode not found |
| 3 | invalid record number |
| 4 | error opening data files |
| 5 | file read error |
| 6 | end of search |
| 7 | registration failure |
It is possible to control the search procedure carried out by PCP-DOS. Knowing only part of the address should be enough to allow you to acquire the full address, using the correct search technique. Listed below are some examples of different searching techniques:
If you know the post town or street but do not know the postcode, you can search for it by typing the name of town or street at the end of the command line, as shown below:
PCP-DOS -f Great Horton Road, Bradford
This command-line asks for a search to be performed which looks for 'Great Horton Road' and 'Bradford' in the same address record. The result file - PcPlus.TXT will show that the street 'Great Horton Road' contains 19 different postcodes.
If you do not know the full address for an organisation but know the postal area that the company is based within, you can speed up your search by narrowing the range. The command-line for this is:
PCP-DOS -f KA1,KA99,Tesco
This command-line asks for a search to only be performed in the Kilmarnock postal area (KA) and searches for any address records containing the word 'Tesco'.
If you know the name of the company and nothing else, you can perform a wide search to assist you in identifying the full address. The command-line parameter nNNN comes in useful here, as the amount of returned information could prove enormous. The -nNNN parameter allows you to specify a certain number of records to be returned.
To search for the first 500 'Boots' stores in the UK (arranged by Postcode), type the following command:
PCP-DOS -f -n500 Boots
This command-line asks for a search to be performed on the word 'Boots' specifying that no more than 500 records be written to the output file PCPlus.TXT.
If you only want to see the first Postcode from each sector that contains a certain street name (sectors being KA1, KA2, KA3 etc) type:
PCP-DOS -f -s High Road
This command-line asks for a search to be performed returning the first address record that contains the words 'High Road', with the added restriction of only showing one record per sector.
Most of the command-line parameters have already been discussed earlier in this document. The parameters that have not been mentioned so far are -m, -a and -s. The best way to explain each of their functions is to work through examples.
The command-line:
PCP-DOS -f -m Ka1,Ka99,Tesco
will return a text file containing the list of 'Tesco' stores in the Kilmarnock postal area. This is the equivalent of typing PCP-DOS -f Ka1,Ka99,Tesco
as the -m parameter executes by default.
The command-line
PCP-DOS -f -a Ka1,Ka99,Tesco
will return a text file containing the full address list for every postcode within the postal area, marking the address records containing the word 'Tesco'with the letter 'm'.
The command-line
PCP-DOS -f Ka1,Ka99,High
will return a text file which holds every address record that contains the word 'high' starting from the sector KA1, working through each sector, returning each record as it is found.
The command-line
PCP-DOS -f -s Ka1,Ka99,High
will return a text file which holds one record from each sector which contains the word 'high', starting from sector KA1 and moving to sector KA2 then KA3 etc.
| Postcode Plus | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
![]() |
| Manual Contents | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
![]() |
| Appendix | ||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||
![]() |