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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.