Hi All,
I used below codes i.e. with Tilde and without tilde(~). And getting the same result . Can yo explain why is it so?
case1-
Data student;
infile cards dsd dlm=',';
Input id team $25.;
Cards;
1,"Green House,NCSS"
2,"Green House,ABPS"
3,"Green House,JKLM"
;
proc print;
Run;
case 2-
Data student;
infile cards dsd dlm=',';
Input id team ~ $25.;
Cards;
1,"Green House,NCSS"
2,"Green House,ABPS"
3,"Green House,JKLM"
;
proc print;
Run;
same outputfor both cases-
id team
| 1 | "Green House,NCSS" |
| 2 | "Green House,ABPS" |
| 3 | "Green House,JKLM" |
While I expect to not receive quotes in output for case 1 scenario, as per the DSD fuctionality.
PLease explain Why getting same output.
Thanks,
Nirupama
Data student;
infile cards dsd ;
Input id team : $25.;
Cards;
1,"Green House,NCSS"
2,"Green House,ABPS"
3,"Green House,JKLM"
;
Data student1;
infile cards dsd ;
Input id team ~ :$25.;
Cards;
1,"Green House,NCSS"
2,"Green House,ABPS"
3,"Green House,JKLM"
;
EDIT: Applies only when you use list input and not formatted input (this is the reason)
Data student;
infile cards dsd ;
Input id team : $25.;
Cards;
1,"Green House,NCSS"
2,"Green House,ABPS"
3,"Green House,JKLM"
;
Data student1;
infile cards dsd ;
Input id team ~ :$25.;
Cards;
1,"Green House,NCSS"
2,"Green House,ABPS"
3,"Green House,JKLM"
;
EDIT: Applies only when you use list input and not formatted input (this is the reason)
that is because the , is within a quoted string. DLM works with the cards not the quoted strings you have.
No,
run and see
Data student;
infile cards dsd dlm=',' ;
Input id team : $25.;
Cards;
1,"Green House,NCSS"
2,"Green House,ABPS"
3,"Green House,JKLM"
;
Data student1;
infile cards dsd dlm=',';
Input id team ~ :$25.;
Cards;
1,"Green House,NCSS"
2,"Green House,ABPS"
3,"Green House,JKLM"
;
The only change I did was using a colon format modifier to read team with a list input
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.