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;
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
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
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!
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.