BookmarkSubscribeRSS Feed
Jcox22
Calcite | Level 5

I'm a new SAS programmer and am currently working on a dataset thats disorganized like this:

 

data1 var1 data2 var2 data3 var3

data1 var1 data1 var1 data2 var2 ...

 

I was wondering if there was a pointer in sas (like @)  that would allow me to point before the variable to organize the data. Thanks

 

 

EDIT: Resolved

2 REPLIES 2
Astounding
PROC Star

Not sure if this is what you are after, but the INPUT statement supports moving to a character string within the line such as:

 

input @'data1' +5 var1;
Kurt_Bremser
Super User

In your second row, you have two values for "var1". How do you want to handle such an occurrence? First value, last value, or do you want to output a separate observation for each value? In the latter case, what do you want to do with the other name/value pairs in the same input line?

It would be helpful if you posted the expected dataset from your input data.