Hi All,
Sometimes when I hold the value of a variabe in SAS, I am unsure where to use the trailing @ as I get an error when reading other variables. I use this as an example:
Suppose I want to read this text tab delimited file:
Andrew Rapayer 45 61
Abbey Murrey 10 9
Tina Amber 10 20
I should hold the value of Andrew Rapayer and then read off the next two values using @. The code I use:
Data test;
infile "C:\SAS\test.txt" dlm = ' ';
input Name & : $15. @
Age : 2.
Height : 2.
;
run;
Since I am using dlm ='' option so each value is seperated by a space so when I read first obs from text file it would treat Andrew & Rapayer as seperate values but I want to input that as Name so I am using & to read this and then hold the value using @ but I get an error when reading the Age:
ERROR 22-232 : Expecting a Name.
Kindly advise what is the missing link.
Kind Regards
SK