The single @ is temporary, for the current iteration of the DATA step only.
The double is permanent. The only way to get to the next line includes:
The single @ is temporary, for the current iteration of the DATA step only.
The double is permanent. The only way to get to the next line includes:
Why not play with it and see what happens?
data test1;
interation+1;
do col=1 to 3 ;
input x @;
output;
end;
cards;
1 2 3 4 5 6
7 8 9 10 11 12
;
proc print;
run;
data test2;
interation+1;
do col=1 to 3 ;
input x @@;
output;
end;
cards;
1 2 3 4 5 6
7 8 9 10 11 12
;
proc print;
run;
A SINGLE trailing "@" holds the input buffer only for the current iteration of the data step (i.e, til processing returns to the top of the data step), or is passed a subsequent INPUT statement without a trailing "@".
A DOUBLE trailing "@" holds the input buffer indefinitely (i.e, multiple iterations of the data step) as long as there is data in the input buffer to read.
Hope that helps?
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.