If a variable doesn’t 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
002 F 40 G
To read these values to the datastep
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.;
002 F 40 G
The double trailing holds the until the end of the record.
input id age @@;
001 23 002 43 003 65 004 32 005 54