Hi, there,
Can anyone please show me how to transpose data with missing ID /CODE? Please see the sample enclosed.
See the screenshot below:
I can't open excel-files, so could you please post the data as data-step using datalines-statement? See https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/ for details.
Please post your dataset in a usable way (data step with datalines), and the code you used for the transpose.
I cleaned up your Excel file, and ran this:
proc import
datafile="/folders/myfolders/transpose1.xlsx"
out=transpose1
dbms=xlsx
replace
;
run;
proc transpose data=transpose1 out=trans;
var year:;
by code notsorted;
id datatype;
run;
which worked for me.
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.