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
How can sas program be validated?
Mention the difference between ceil and floor functions in sas?
If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable? : sas-macro
Approximately what date is represented by the SAS date value of 730?
Which are the statements whose placement in the data step is critical?
Tell me more about the parameters in macro? : sas-macro
What is SAS? What are the functions does it performs?
what is the difference between floor and ceil functions in sas? : Sas-administrator
What is the difference between proportion and average?
Explain by-group processing?
Mention some common errors that are usually committed in sas programming.
Name and describe few sas character functions that are used for data cleaning in brief.
What is the difference between using drop = data set option in data statement and set statement?
What is the use of divide function?
Mention what is the difference between nodupkey and nodup options?