Ruth 39 11
Jose 32 22
Sue 30 33
John 40 44
data test ;
infile 'C:\Users\LENOVO\Desktop\test.txt' ;
input a $1-4 ;
if a='Ruth' then input idnum 10-11 ;
else input age 7-8 ;
run;
it gives only ruth what about idnum,age.
it shows missing values in age,numeric variables
You forgot to hold the row pointer with @.
And since the columns are not at fixed places, you mostly try to read blanks for numbers.
STRONG hint: when posting examples of external files, ALWAYS use the {i} button, as that subwindow keeps the vertical alignment as-is. The main posting window tends to eat successive blanks, or replace tab characters.
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.