Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


single and double trailing

single and double trailing

single and double trailing

Hey guys,
        I am trying to understand the difference between @ and @@. For the data below both works.So whats the diff and why do we need another @ (input sales :comma.)to read the data below...(Is there a simple way to solve problems with single and double trailing)

0734 1,323.34 2,472.85 3,276.65
0987 1,393.34 9,472.85 2,276.65


data Single;
infile test;
input id $ @@;  *Double trailing works;
do qtr = 1 to 3;
input sales :comma.@; *Why single trailing here;


data Single;
infile test;
input id $ @;   *Single trailing works;
do qtr = 1 to 3;
input sales :comma.@;  *Why single trailing here;

RE: single and double trailing

This is explained in the documentation online.


Look under Base SAS > SAS Language Reference: Dictionary > Dictionary of Language Elements > Statements > Input > Using Line-Hold Specifiers.

Basically, a single trailing @ allows multiple INPUT statements to read the same line of data, however, these all go to the same observation, the next iteration of the datastep reads the next line of data.
A double trailling @ allows you to write out multiple records from the same line of data.
This is more fully explained in the doco though.  If you have an earlier version of SAS this shouldn't be a problem, I don't beleive this has changed in a long time.

RE: single and double trailing

Thanks Chris that helped...

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close