DATASOURCE Procedure

Example 12.6 PC Format CITIBASE Database

(View the complete code for this example.)

This example uses a PC format CITIBASE database (FILETYPE=CITIDISK) to extract annual population estimates for females and males with respect to various age groups.

Population estimate series for all ages of females including those in the armed forces overseas are given by PANF, while PANM gives the population estimate for all ages of males including those in armed forces overseas. More population estimate time series are described in Output 12.6.1 and are output in Output 12.6.2.

The following statements extract the required population estimates series:

filename keyfile "%sysget(DATASRC_DATA)basekey.dat" RECFM=V LRECL=22;
filename indfile "%sysget(DATASRC_DATA)baseind.dat" RECFM=F LRECL=84;
filename dbfile "%sysget(DATASRC_DATA)basedb.dat" RECFM=F LRECL=4;

proc datasource filetype=citidisk  infile=( keyfile indfile dbfile )
                out=popest outall=popinfo;

run;

proc print data=popinfo;
run;
proc print data=popest;
run;

Output 12.6.1: Listing of the OUTALL=POPINFO Data Set for FILETYPE=CITIDISK

ObsNAMESELECTEDTYPELENGTHVARNUMBLKNUMLABELFORMATFORMATLFORMATDST_DATEEND_DATENTIMENOBSDISKNUMATTRIBUTNDECAGGREGAT
1PAN11521POPULATION EST.: ALL AGES, INC.ARMED F. OVERSEAS(THOUS.,ANNUAL) 001980198910101100
2PAN1711532POPULATION EST.: 16 YRS AND OVER,INC ARMED F.OVERSEAS(THOUS,ANNUAL) 001980198910101100
3PAN1811543POPULATION EST.: 18-64 YRS,INC.ARMED F.OVERSEAS(THOUS,ANNUAL) 001980198910101100
4PANF11554POPULATION EST.: FEMALES,ALL AGES,INC.ARMED F.O'SEAS(THOUS.,ANN) 001980198910101100
5PANM11565POPULATION EST.: MALES, ALL AGES, INC.ARMED F.O'SEAS(THOUS.,ANN) 001980198910101100


Output 12.6.2: Printout of the OUT=POPEST Data Set for FILETYPE=CITIDISK

ObsDATEPANPAN17PAN18PANFPANM
11980227757172456138358116869110888
21981230138175017140618118074112064
31982232520177346142740119275113245
41983234799179480144591120414114385
51984237001181514146257121507115494
61985239279183583147759122631116648
71986241625185766149149123795117830
81987243942187988150542124945118997
91988246307189867152113126118120189
101989248762191570153695127317121445


This example demonstrates the following:

  • The INFILE= options lists the filerefs of the key, index, and database files, in that order.

  • The INTERVAL= option is omitted since the default interval for CITIDISK type files is YEAR.

Last updated: June 19, 2025