BookmarkSubscribeRSS Feed
thanikondharish
Fluorite | Level 6

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

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Follow up marking posts as answered by providing test data in the form of a datastep:

https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

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;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 915 views
  • 4 likes
  • 3 in conversation