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?
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.