DATA Step, Macro, Functions and more

Reading data using input statement

Trusted Advisor
Posts: 1,270

Reading data using input statement

Hi Experts,

While reading a very large data (Millions of record in data file with both character and numeric variables) using input statement, what is the best way to validate the total data is completely read or something is missing?

Thanks in advance for your suggestions.

Super User
Super User
Posts: 8,093

Re: Reading data using input statement

Read the notes in the log.

NOTE: 19 records were read from the infile TMPFILE1.

      The minimum record length was 17.

      The maximum record length was 21.

NOTE: The data set WORK.WANT has 19 observations and 5 variables.

Valued Guide
Posts: 2,191

Re: Reading data using input statement

The MEANS procedure could give you counts for missing cells in all columns with brief code like :

proc means noprint;

var _numeric_ ;

Output nmiss=;

run ;

%let missDS= &SYSLAST ;

I assumed you would execute this code straight after the input step so the procedure default input dataset name rule applies (most recently created dataset).

With no OUT= defined on the OUTPUT statement tge procedure creates new table in the DATAn sequence which my syntax collects from &SYSLAST.

This table has one row with a counter variable named like the numeric variables in your input dataset. These count the missing cells. I guess you hope for a set of zeroes.

Good luck


Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation