I have an excel .csv file that looks like this:
Type Value
Time 1:00 pm
Level1 52.3
Level2 52.3
Level3 52.3
Level4 52.3
I import it into SAS (version 9.4) and use proc transpose and get data that looks like this:
Name of Former Variable COL1 COL2 COL3 COL4 COL5
Type Time Level1 Level2 Level3 Level4
Value 52.3 52.3 52.3 52.3 52.3
My goal is to turn the second row into the actual variable name: COL1 = Time; COL2 = Level1, etc.
I'm so stumped. Does anyone have any sugestions on appropriate code?
Fix your proc transpose:
proc transpose data=have out=want;
var value;
id type;
run;
Did you use the ID option in proc transpose?
Can you post your code?
The only code I've used is
proc import datafile="C:levels.csv"
out=ndb103232015
dbms=csv
replace;
getnames=yes;
run;
proc transpose data=ndb103232015 out=ndb103232015_transpose; var type value; run;
Fix your proc transpose:
proc transpose data=have out=want;
var value;
id type;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.