hi guys
I want SAS to read in the following:
data one;
input name & :$20. age;
cards;
Marry lee Jones 40
Arnold Jonson 45
;
but i get errors
What am i doing wrong here?
please help?
& says to keep reading until it sees two or more spaces. So the 40 on the first line becomes part of the name. It then needs to go to the next line to read the age and cannot translate Arnold into a number. Hence the error message.
Add an extra space in front of the age on each row.
& says to keep reading until it sees two or more spaces. So the 40 on the first line becomes part of the name. It then needs to go to the next line to read the age and cannot translate Arnold into a number. Hence the error message.
Add an extra space in front of the age on each row.
That was quick and sweet
Thanks Tom
Hi Tom,
Based on this discussion, I need to learn how can we refer variable names with spaces or dash - or dots (.) betwen them in arrays?
e.g. NON BUYERS
Thanks,
Naeem
Start a new thread and explain in more detail what you want.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.