data newdata;
Input
@1A
@3B
@5C
@7D;
datalines;
1 2 3 4
1 2 2
2 2 2
;
run;
Proc Print data = newdata;
run;
Please see the input var definitions below:
data newdata;
Input
@1 A $1.
@3 B $1.
@5 C $1.
@7 D $1.;
datalines;
1 2 3 4
1 2 2
2 2 2
;
run;
Proc Print data = newdata;
run;
Here is the output for your reference...
Obs A B C D
1 1 2 3 4
2 1 2 2
3 2 2 2
Hope this helps. Good Luck...!!!
These both work
data newdata;
infile datalines missover;
Input
A 1-2
B 3-4
C 5-6
D 7-8
;
datalines;
1 2 3 4
1 2 2
2 2 2
;
run;
data newdata;
infile datalines missover;
Input
A f2.
B f2.
C f2.
D f2.
;
datalines;
1 2 3 4
1 2 2
2 2 2
;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.