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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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