Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PROC IMPORT DATAFILE="C:\SASDATA\labs.csv"
- OUT=SASDATA.labs_wide
- DBMS=csv
- REPLACE;
- GUESSINGROWS=5000;
- GETNAMES=yes;
- RUN;
- PROC SORT DATA=sasdata.labs_wide
- OUT=labs2
- NODUPKEY DUPOUT=duplicates;
- BY _ALL_;
- RUN;
- PROC TRANSPOSE DATA=labs2
- OUT=labs3
- NAME=Test
- PREFIX=Value;
- BY ID Name "Test Date"n;
- RUN;
- DATA labs4;
- SET labs3;
- F_Name = SCAN(Name,1,' ');
- L_Name = SCAN(Name,2,' ');
- RENAME Value1=Value;
- RUN;
- DATA sasdata.labs_narrow;
- RETAIN ID F_Name L_Name "Test Date"n Test Value;
- DROP Name;
- SET labs4;
- IF Value= . THEN Delete;
- RUN;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement