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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1231 views
  • 0 likes
  • 3 in conversation