Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The DATASOURCE Procedure

Obtaining Descriptive Information on Cross Sections

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.

   filename ifsfile 'host-specific-file-name' <host-options>;
   proc datasource filetype=imfifsp infile=ifsfile
                   interval=month outby=xsection;
   run;
   
   title1 'Some Cross Sections Available in IFSFILE';
   proc print data=xsection noobs;
   run;

Some Cross Sections Available in IFSFILE

country csc partner version st_date end_date ntime nobs nseries nselect c_name
1 F 900 Z . . . 0 0 0 WORLD
1 F   Z JAN1957 DEC1989 396 396 46 23 WORLD
1 T   Z JAN1957 DEC1989 396 396 16 8 WORLD
10 F   Z JAN1957 DEC1989 396 396 32 16 ALL COUNTRIES
10 F 900 Z . . . 0 0 0 ALL COUNTRIES
10 M   Z JAN1957 NOV1989 395 395 2 1 ALL COUNTRIES
10 T   Z JAN1957 DEC1989 396 396 18 9 ALL COUNTRIES
16 F   Z JAN1970 SEP1989 237 237 12 6 OFFSHORE BNKING CTRS
16 F 900 Z . . . 0 0 0 OFFSHORE BNKING CTRS
24 F   Z JAN1962 JUL1989 331 331 2 1 ACP COUNTRIES

Figure 10.4: Partial Listing of the OUTBY= Data Set

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 the eight series defined for cross section (COUNTRY='1' CSC='T' PARTNER=' ' and VERSION='Z'):

   filename ifsfile 'host-specific-file-name' <host-options>;
   proc datasource filetype=imfifsp infile=ifsfile interval=month
                   outall=ifsall;
   run;
   
   title1 'Time Series Defined in Cross Section';
   title2 "COUNTRY='1'  CSC='T'  PARTNER=' '  VERSION='Z'";
   proc print data=ifsall noobs;
      where country='1' and csc='T' and  partner=' ' and version='Z';
   run;

Time Series Defined in Cross Section
COUNTRY='1' CSC='T' PARTNER=' ' VERSION='Z'

country csc partner version name kept selected type length varnum blknum label format formatl formatd st_date end_date ntime nobs c_name subject scdata datatype du_code du_name ndec baseyear source
1 T   Z F__2KS 1 1 1 5 . 26 TOTAL PURCHASES   0 0 JAN1957 DEC1989 396 396 WORLD     F S MILLIONS OF SDRS 1   T
1 T   Z F__2LA 1 1 1 5 . 27 REPMTS.BY REPUR.IN PERIOD   0 0 JAN1957 DEC1989 396 396 WORLD     F S MILLIONS OF SDRS 2   T
1 T   Z F__2MS 1 1 1 5 . 28 TOTAL PURCHASES BY OTHERS   0 0 JAN1957 DEC1989 396 396 WORLD     F S MILLIONS OF SDRS 1   T
1 T   Z F__2NS 1 1 1 5 . 29 TOTAL REPURCHASES BY OTHERS   0 0 JAN1957 DEC1989 396 396 WORLD     F S MILLIONS OF SDRS 2   T
1 T   Z F_C2KS 1 1 1 5 . 30 TOTAL PURCHASES,CUM.   0 0 JAN1957 NOV1986 359 359 WORLD   C S S MILLIONS OF SDRS 1    
1 T   Z F_C2LA 1 1 1 5 . 31 REPAYMENTS BY REPURCHASE,CUM.   0 0 JAN1957 DEC1989 396 396 WORLD   C S S MILLIONS OF SDRS 1    
1 T   Z F_C2MS 1 1 1 5 . 32 TOTAL PURCHASES BY OTHERS,CUM   0 0 JAN1957 NOV1986 359 359 WORLD   C S S MILLIONS OF SDRS 1    
1 T   Z F_C2NS 1 1 1 5 . 33 TOTAL REP.BY OTHERS,CUM.   0 0 JAN1957 DEC1989 396 396 WORLD   C S S MILLIONS OF SDRS 1    

Figure 10.5: Partial Listing of the OUTALL= Data Set

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 for which data are available. The OUTBY= data set in this case contains a single observation reporting the number of series and time ranges for the whole data file.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.