If a variable doesnt have a single trailing @ with an input statement, when sas encounters another input statement after the first one,it would load a new record, this action will result in some observations not been outputted and missing data. To avoid this, a single trailing @ is used to hold the record , so that when it encounters another input statements within the datasets a new record is not loaded, It basically tells sas to use the data just placed in the input buffer for the next input statement . the single trailing @ is release when an input statement without a trailing @ is encountered.
`input zz$ status tells SAS to read two words at a time from the input buffer to the pdv without discarding the rest of the line.Without the trailing , SAS would read the first two words from input buffer and ignore therest of the line. This would result in reading less records.
They are used for the records such as 001F38 H 002 F 40 G To read these values to the datastep Data example; input @10 type $ @; if type=H then input @1 id 3. @4 gender $1. @5 age2.; else if type=G then input @1 id3. @5 gender $1. @7 age 2.; end; cards; 001F38 H 002 F 40 G ; run; The double trailing holds the until the end of the record. Data example2; input id age ; cards; 001 23 002 43 003 65 004 32 005 54 ; run;
Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!