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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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