A print-out of this data confirms that this IF-THEN statement is working as intended. PROC PRINT DATA=Medicare; VAR ObsNumber line_srvc_cnt Total_line_srvc_cnt; RUN; You are now ready to stream the entire dataset. Simply remove the obs=100 line and change the THEN statement as shown. Modification to INFILE Statement Modifications to OUTPUT statement INFILE ‘ <file location> / <file name> ‘ IF EOF OUTPUT; lrecl=32767 dlm='09'x or pad missover IF MOD(ObsNumber,1000000) = 0 OR firstobs = 3 EOF THEN OUTPUT; dsd obs=100 end = EOF ; After the modifications specified above are made to the INFILE and OUTUT statements, the following output is obtained. Note: The compound IF Statement was used for this output, i.e. IF MOD(ObsNumber,1000000) = 0 OR EOF THEN OUTPUT; The Total Number of Services Provided in this dataset is determined to be 2359294147.3. One final comment is that SAS has the ability to completely “skip” actually creating a dataset in this process. The processing of creating a dataset is done, but the output will be placed directly into a LOG and, generally speaking, the data is not available beyond these initial computations. Standard Approach for Creating Creating an Internal a SAS Dataset SAS Dataset DATA Medicare DATA _NULL_ : : : : RUN; RUN;
A print-out of this data confirms that this IF-THEN statement is working as intended. PROC PRINT DATA=Medicare; VAR ObsNumber line_srvc_cnt Total_line_srvc_cnt; RUN; You are now ready to stream the entire dataset. Simply remove the obs=100 line and change the statement as shown. Modification to INFILE Statement Modifications to OUTPUT statement INFILE ‘ <file location> / <file name> ‘ lrecl=32767 dlm='09'x pad missover firstobs = 3 dsd obs=100 end = EOF ; IF EOF THEN OUTPUT; or IF MOD(ObsNumber,1000000) = 0 OR EOF THEN OUTPUT; After the modifications specified above are made to the INFILE and OUTUT statements, the following output is obtained. Note: The compound IF Statement was used for this output, i.e. IF MOD(ObsNumber,1000000) = 0 OR EOF THEN OUTPUT; The Total Number of Services Provided in this dataset is determined to be 2359294147.3. One final comment is that SAS has the ability to completely “skip” actually creating a dataset in this process. The processing of creating a dataset is done, but the output will be placed directly into a LOG and, generally speaking, the data is not available beyond these initial computations. Standard Approach for Creating a SAS Dataset DATA Medicare : : RUN; Creating an Internal SAS Dataset DATA _NULL_ : : RUN;
Handout7_SP18_v3.docx