BookmarkSubscribeRSS Feed
yemji
Calcite | Level 5
I have two rows read from a file with three variables as below
var1 var2 var3
a b
c

the output needs to be like dis
var1 var2 var3
a b c
5 REPLIES 5
novinosrin
Tourmaline | Level 20
data have;
input var1 $ var2 $/ var3$;
cards;
a b
c
;
PeterClemmensen
Tourmaline | Level 20

So your data looks like this, correct? Is this data actually representative of your data?

 

data have;
input var1 $ var2 $ var3 $;
infile datalines missover;
datalines;
a b
c
;
yemji
Calcite | Level 5
nope this is how i am getting my output. i am trying to read a file im which first row contains data for first two observations and second row contains data for the third observation.
novinosrin
Tourmaline | Level 20
first row contains data for first two observations or is it variables? did you test the code i gave you?
yemji
Calcite | Level 5
sorry my bad its variables. let me try and get back

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1130 views
  • 0 likes
  • 3 in conversation