Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

Join Tek-Tips
*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.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

roland9 (TechnicalUser) (OP)
25 Feb 06 13:39
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)

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

*Problem_1;

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

*Problem_2;

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

ChrisW75 (Programmer)
26 Feb 06 17:31
This is explained in the documentation online.

http://support.sas.com/onlinedoc/913/docMainpage.jsp

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.
roland9 (TechnicalUser) (OP)
26 Feb 06 19:01
Thanks Chris that helped...

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