The SAS Output Delivery System and reporting techniques

data importing

New Contributor jbr
New Contributor
Posts: 4

data importing

does anyone know how to import records with multiple lines per record where each line has a end of line character(/) ?
Contributor lu
Posts: 23

Re: data importing

Hi jbr

Reading More Than One Record per Observation

The highest number that follows the # pointer control in the INPUT statement determines how many input data records are read into the input buffer. Use the N= option in the INFILE statement to change the number of records. For example, in this statement, the highest value after the # is 3:

input @31 age 3. #3 id 3-4 #2 @6 name $20.;
Unless you use N= in the associated INFILE statement, the INPUT statement reads three input records each time the DATA step executes.

When each observation has multiple input records but values from the last record are not read, you must use a # pointer control in the INPUT statement or N= in the INFILE statement to specify the last input record. For example, if there are four records per observation, but only values from the first two input records are read, use this INPUT statement:

input name $ 1-10 #2 age 13-14 #4;

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation