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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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