BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Debugger
Fluorite | Level 6

Hi Guys,

 

Probably pretty simple mistake.

Got the following Error. Sth seems to be wrong with my "Format".

 

MPRINT(LOOP): Create Table Abgleich24 AS Select "TRAG" AS Schau_Stichwort_ID length=30, "BEISPIEL" AS Tabelle

length=30, "BEISPIEL_BETR" AS Feld length=30, t2.Schau_NM length=30, BEISPIEL_BEITR AS BEITR_NM length=30

Format 'BEITR_NM' = $6 From t1;

ERROR 22-322: Syntax error, expecting one of the following: a format name, =.

 

 

Proc SQL;

Create Table Abgleich&i AS

 Select "&&Schau&i" AS Schau_ID length=30, 

"&&Tabelle&i" AS Tabelle length=30,

"&&Feld&i" AS Feld length=30, 

 t2.Schau_NM length=30, 

 &&Feld&i AS Schau_NM length=30

 Format 'Schau_NM' = $6

 

From WORK.Fokus t1;

 Left join work.Fokus_Schau t2 ON (t1.&&Feld&i = t2.Schau_NM);

 

Quit;



%End;

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
BEISPIEL_BEITR AS BEITR_NM length=30 Format 'BEITR_NM' = $6 From t1;

should say

 

BEISPIEL_BEITR AS BEITR_NM length=30 Format = $6. From t1;

please note the dot after $6

--
Paige Miller

View solution in original post

2 REPLIES 2
novinosrin
Tourmaline | Level 20

HI @Debugger  Is the erroneous semicolon here?

 

From WORK.Fokus t1;
PaigeMiller
Diamond | Level 26
BEISPIEL_BEITR AS BEITR_NM length=30 Format 'BEITR_NM' = $6 From t1;

should say

 

BEISPIEL_BEITR AS BEITR_NM length=30 Format = $6. From t1;

please note the dot after $6

--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 829 views
  • 0 likes
  • 3 in conversation