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


Please Help Members By Posting Answers For Below Questions

What is the difference between one to one merge and match merge? Give an example.

565


what are the considerations when picking a SAS/STAT procedure?

2894


how will you locate the sas platform applications? : Sas-bi

578


for what purpose would you use the retain statement? : Sas programming

575


What is program data vector (pdv)?

627






explain the main difference between the nodup and nodupkey options? : Sas-administrator

682


What is maximum storage capability of SAS?

904


What are the ways to do a “table lookup” in sas?

587


What is a put statement?

660


how many types prompting framework can be broken down to? : Sas-bi

624


How would you include common or reuse to be processed along with your statements?

1894


What are the statements in proc sql?

587


What is SAS?

617


what is sas business intelligence? : Sas-bi

582


how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming

594