Learning SAS? Welcome to the exclusive online community for all SAS learners.

how to get the row values as column names

Reply
Contributor
Posts: 42

how to get the row values as column names

hi friends .

i have the one data set  like         

ABCD
....
....
JAN15FEB15MAR15APR15
210125542125
325452148145
125362423125
258161712

THIS data set is  one column is added   monthly

Note: not using rename .

  

the result  data set like

JAN15  FEB15  MAR15  APR15

210       125       542       125

325       452       148       145

125       362       423       125

258       16         17         12

how to get the   above data set

plz help me.

thanks

T.lakshminarayana

Valued Guide
Posts: 860

Re: how to get the row values as column names

Posted in reply to tlnarayana26

How are you importing this?

Super User
Super User
Posts: 7,078

Re: how to get the row values as column names

Posted in reply to tlnarayana26

Import the file again and this time tell it that the data and headers start lower in the file.

Or you could dump it back out to a CSV file and re-import it.

filename dump temp ;

data _null_;

  set have ;

  file dump dsd lrecl=30000 ;

  if cmiss(of a b c d) < 4 then put (_all_) (Smiley Happy ;

run;

proc import datafile=dump out=want dbms=dlm replace;

  delimiter=',' ;

run;

Contributor QLi
Contributor
Posts: 59

Re: how to get the row values as column names

Posted in reply to tlnarayana26

try additional step  in Excel by transposing, then import into SAS data

Ask a Question
Discussion stats
  • 3 replies
  • 343 views
  • 0 likes
  • 4 in conversation