F1 | F2 | F3 | F4 | F5 |
STUDYID | 1 | Study Identifier | string | 8 |
DOMAIN | 2 | Domain Abbreviation | string | 2 |
USUBJID | 3 | Unique Subject Identifier | string | 16 |
DSSEQ | 4 | Sequence Number | integer | 8 |
DSTERM | 5 | Reported Term for the Disposition Event | string | 200 |
DSDECOD | 6 | Standardized Disposition Term | string | 200 |
DSCAT | 7 | Category for Disposition Event | string | 50 |
DSSCAT | 8 | Subcategory for Disposition Event | string | 50 |
VISITNUM | 12 | Visit Number | integer | 8 |
VISIT | 13 | Visit Name | string | 50 |
DSSTDTC | 14 | Start Date/Time of Disposition Event | string | 19 |
DSSTDY | 16 | Study Day of Start of Disposition Event | integer | 8 |
PROC SQL ;
CREATE TABLE AT AS
SELECT 'LABEL'||' '||STRIP(F1)||' '||"='"||STRIP(F3)||"'" AS NEW,
CASE WHEN UPCASE(F4)='STRING' THEN
STRIP(F1)||' '||"='"||STRIP(F3)||"'"||' LENGTH=$'||STRIP(F5)||'.' END
AS NEW1,
case WHEN CALCULATED NEW1=' ' THEN NEW END AS NEW2
FROM S1 ;
QUIT;
when concatinated some variable it gives error
can you explain that
Start with accepting solutions to your previous questions.
Follow up marking posts as answered by providing test data in the form of a datastep:
Then show what the output should look like. Maybe:
data want;
set have;
length line $2000;
line=catx(' ','label',f1,'=',quote(f3),'length=',ifc(f4='string',cats('$',f5),f5));
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.