DATASOURCE Procedure

Obtaining Descriptive Information on Cross Sections

(View the complete code for this example.)

If you want to know the unique set of values BY variables assume for each cross section in the data file, use the OUTBY= option. For example, the following statements list some of the cross sections available for an IFS file, and are shown in Figure 3:

filename ifsfile "%sysget(DATASRC_DATA)imfifs1.dat" RECFM=F LRECL=88;
proc datasource
   filetype=imfifsp infile=ifsfile
   outselect=on ebcdic
   interval=month
   outby=xsection;
run;

title1 'Some Cross Sections Available in IFSFILE';
proc print data=xsection;
run;

Figure 3: Listing of the OUTBY= Data Set

Some Cross Sections Available in IFSFILE

ObsCOUNTRYCSCPARTNERVERSIONST_DATEEND_DATENTIMENOBSNSERIESNSELECTCNTYNAME
1111F ZJAN1957SEP198635735763UNITED STATES
2112F ZJAN1957SEP198635735763UNITED KINGDOM
3146F ZJAN1957SEP198635735763SWITZERLAND
4158F ZJAN1957SEP198635735763JAPAN
5186F ZJAN1957SEP198635735763TURKEY


The OUTBY= data set reports the total number of series, NSERIES, defined in each cross section, NSELECT of which represent the selected variables. If you want to see the descriptive information on each of these NSELECT variables for each cross section, specify the OUTALL= option. For example, the following statements print descriptive information on all monthly series defined for all cross sections (COUNTRY=’111’, COUNTRY=’112’, COUNTRY=’146’, COUNTRY=’158’, and COUNTRY=’186’), which are shown in Figure 4:

filename datafile "%sysget(DATASRC_DATA)imfifs1.dat" RECFM=F LRECL=88;

title3 'Time Series Defined in Cross Section';
proc datasource filetype=imfifsp
   outselect=on ebcdic
   interval=month
   outall=ifsall;
run;

title4 'Cross Sections Available in OUTALL=IFSALL Data Set';
proc print
   data=ifsall;
run;

Figure 4: Listing of the OUTALL= Data Set

Time Series Defined in Cross Section
Cross Sections Available in OUTALL=IFSALL Data Set

ObsCOUNTRYCSCPARTNERVERSIONNAMEKEPTSELECTEDTYPELENGTHVARNUMBLKNUMLABELFORMATFORMATLFORMATDST_DATEEND_DATENTIMENOBSCNTYNAMESUBJECTSCDATADATATYPEDU_CODEDU_NAMENDECBASEYEARSOURCE
1111F ZF___AA1115.1MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357UNITED STATES  SEU U5  
2111F ZF___AC1115.2MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357UNITED STATES  SFU U5  
3111F ZF___AE1115.3MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357UNITED STATES  SAU U5  
4112F ZF___AA1115.4MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357UNITED KINGDOM  SEU U6  
5112F ZF___AC1115.5MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357UNITED KINGDOM  SFU U5  
6112F ZF___AE1115.6MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357UNITED KINGDOM  SAU U6  
7146F ZF___AA1115.7MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357SWITZERLAND  SEU4  
8146F ZF___AC1115.8MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357SWITZERLAND  SFU6  
9146F ZF___AE1115.9MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357SWITZERLAND  SAU4  
10158F ZF___AA1115.10MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357JAPAN  SEU3  
11158F ZF___AC1115.11MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357JAPAN  SFU6  
12158F ZF___AE1115.12MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357JAPAN  SAU3  
13186F ZF___AA1115.13MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357TURKEY  SEU3  
14186F ZF___AC1115.14MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357TURKEY  SFU5  
15186F ZF___AE1115.15MARKET RATE CONVERSION FACTOR 00JAN1957SEP1986357357TURKEY  SAU3  


The OUTCONT= data set contains one observation for each time series variable with the descriptive information summarized over BY groups. When the data file contains no cross sections, the OUTCONT= and OUTALL= data sets are equivalent, except that the OUTALL= data set also reports time ranges of available data. The OUTBY= data set in this case contains a single observation reporting the number of series and time ranges for the whole data file.

Last updated: June 19, 2025