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

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 1374 views
  • 0 likes
  • 3 in conversation