Interview Questions   Tutorials   Discussions   Programs   Videos   

SAS - What is the purpose of the trailing @? The ? How would you use them?




528
views
asked mar September 20, 2014 06:30 AM  

What is the purpose of the trailing @? The ? How would you use them?


           

1 Answers



 
answered By vishnoiprem   0  

@ holds input record for execution of next INPUT within same iteration of DATA step (trailing @ ) holds input record for execution of next INPUT across iterations of DATA step (double trailing @

Sometimes you may need to create multiple observations from a single record of raw data. One way to tell SAS how to read such a record is to use the other line-hold specifier, the double trailing at-sign ( or "double trailing @"). The double trailing @ not only prevents SAS from reading a new record into the input buffer when a new INPUT statement is encountered, but it also prevents the record from being released when the program returns to the top of the DATA step. (Remember that the trailing @ does not hold a record in the input buffer across iterations of the DATA step.) For example, this DATA step uses the double trailing @ in the INPUT

statement:
data body_fat;
   input Gender $ PercentFat ;
   datalines; 
m 13.3 f 22    
m 22   f 23.2    
m 16   m 12    
;

proc print data=body_fat;
    title 'Results of Body Fat Testing';
run;

The following output shows the resulting data set: Data Set Created with Double Trailing @ Results of Body Fat Testing 1

                                         Percent
                        Obs    Gender      Fat

                         1       m         13.3 
                         2       f         22.0 
                         3       m         22.0 
                         4       f         23.2 
                         5       m         16.0 
                         6       m         12.0 
flag   
   add comment

Your answer

Join with account you already have

FF

Preview

 Write A Tutorials
Online-Classroom Classes
www.writeabc.com


  1 person following this question

  Question tags

sas × 1

Asked 2 years and 3 months ago ago
Number of Views -528
Number of Answers -1
Last updated
3 years and 2 months ago ago

Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert