BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mkeintz
PROC Star

You apparently want to read in raw data, with the desired variables for each record arranged in a column.

 

If the variables are arranged the same way for every observation (i.e. 5 lines of data for each obs), then use "line pointer controls" such as

 

  •  /    which tells SAS to advance one data line
  • #n   which tells SAS to advance to the n'th line in a group

 

So, crudely speaking, you could

data want;
   input x1   /   x2 x3   / x4;
run;

which tells SAS to expect 3 lines for each observations, with variable X1 on the first line,   X2 and X3 on the 2nd line, and X4 on the third line.

 

If this is not a correct interpretation of your problem, please show actual data as you have it, and actual data layout as you want it.

 

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 15 replies
  • 1825 views
  • 6 likes
  • 7 in conversation