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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 1002 views
  • 4 likes
  • 3 in conversation