Add-Innovation Home

About Add-Innovation

Contact Us

  SAS Institute logo.    Only read required data II


When reading input data, use the STOP command to stop reading that file once the last known item has been read (if the data is sorted by that item). Examples ;

Only reading up to district LN from the Inventory file :

Data UpToLN;
    Infile Inventory;
    Input @15 ProdCode $6.@;
    If Prodcode=’A54321’;
    Input @1  DistAcc $10.;
    If DistAcc>:’LN’ Then Stop;

Only reading up to a known account code ;

Data AccList;
Infile Inventory;
Input @15 ProdCode $6. @;
If Prodcode=’A12345’;
Input @1  DistAcc $10.;
Call Symput(‘HiAcc’,DistAcc);

Data UpToLN;
    Infile InstMast;
    Input @1  DistAcc $10.@;
    If DistAcc>:”&HiAcc” Then Stop;
    Input @15 InstStat $1.;
    If Instat=’R’;

Call Symput copies a SAS variable into a SAS macro variable. A macro variable holds a single value throughout a data step regardless of the observation number being processed, and is therefore useful for passing single values between steps.