What is the purpose of the trailing and How would you use them?
Answer Posted / sandhya
The trailing @ or more technically, line hold specifiers
are used to hold the pointer in the same record for
multiple iterations. The two tyoes of line hold specifiers
are single trailing(@) and double trailing(@@).
The single trailing hold the record until it encounters
either another input statement or end of the datastep.
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;
| Is This Answer Correct ? | 19 Yes | 0 No |
Post New Answer View All Answers
Describe the function and utility of the most difficult SAS macro that you have written?
what techniques and/or procs do you use for tables? : Sas programming
what is sas metadata server? : Sas-di
Give some examples where proc report’s defaults are different than proc print’s defaults?
What is the difference between nodupkey and nodup options?
What is auto call macro and how to create a auto call macro? What is the use of it? How to use it in sas with macros? : sas-macro
what is intially documentation in sas?
Explain the difference between nodup and nodupkey options?
What is a method to debug and test your SAS program?
Describe a time when you were really stuck on a problem and how you solved it?
how will you locate the sas platform applications? : Sas-bi
how do you debug and test your sas programs? : Sas programming
What is your favorite all time computer book? Why?
How to create a permanent sas data set?
what is snowflake schema? : Sas-di