Hi Guys,
I currently face another problem with a macro that I recently created.
I feel like the programm does not resolve my macro variables.
Which is strange as it did the day before.
It is just the beginning of a macro, where I compare a Table that includes certain values with lots of other tables including the values.
In the following code I create the macro variables and focus the table on prompts which I created.
In the next Proc SQL statement I create a table focused on the macro variables.
As I said it is just the beginning of a code, however posting the whole code would distract from the problem imo.
Thanks for your help in advance.
Options Mprint; Proc SQL noprint ; Select name, tabellenname, Stichwort_ID Into :Feld1 - , :Tabelle1 - , :ID1 - From Work.GEMAPPT where "&Eingabe_CD_Feld" = name and "&Eingabe_Tabelle" = tabellenname; Quit; Proc SQL; Create Table Fokus AS Select Distinct &Feld1 AS &Feld1, From RC.&Tabelle1; Quit;
Proc SQL;
30 Create Table Fokus AS
31 Select Distinct &Feld1 AS &Feld1,
NOTE: Line generated by the macro variable "SASWORKLOCATION".
31 &Feld
_
22
WARNING: Apparent symbolic reference FELD not resolved.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, BTRIM, INPUT, PUT, SUBSTRING, USER.
NOTE: Line generated by the macro variable "FELD1".
31 "Verbund
____________________
22
ERROR 22-322: Expecting a name.
32 From RC.&Tabelle1;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
NOTE: Line generated by the macro variable "TABELLE1".
32 RC.VERBUND
___
22
76
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, ',', -, '.', /, <, <=, <>, =, >, >=, ?, AND,
BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.
2 The SAS System 14:15 Monday, March 2, 2020
ERROR 76-322: Syntax error, statement will be ignored.
33 Quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
34
35 GOPTIONS NOACCESSIBLE;
36 %LET _CLIENTTASKLABEL=;
37 %LET _CLIENTPROCESSFLOWNAME=;
38 %LET _CLIENTPROJECTPATH=;
39 %LET _CLIENTPROJECTPATHHOST=;
40 %LET _CLIENTPROJECTNAME=;
41 %LET _SASPROGRAMFILE=;
42 %LET _SASPROGRAMFILEHOST=;
43 %SYMDEL Eingabe_CD_Feld;
44 %SYMDEL Eingabe_Tabelle;
45
46 ;*';*";*/;quit;run;
47 ODS _ALL_ CLOSE;
48
49
50 QUIT; RUN;
51
When you try to create &FELD1 and no rows of the data set work.gemappt match the where condition, the the macro variables do not get created. You need to check to see if that is what has happened.
Also, PLEASE follow these instructions when posting the LOG from a SAS program: please help us out in the future by pasting the log file into the window that appears when you click on the {i} icon. This preserves the formatting of the log and makes it easier for us to read and decipher. DO NOT SKIP THIS STEP!
When you try to create &FELD1 and no rows of the data set work.gemappt match the where condition, the the macro variables do not get created. You need to check to see if that is what has happened.
Also, PLEASE follow these instructions when posting the LOG from a SAS program: please help us out in the future by pasting the log file into the window that appears when you click on the {i} icon. This preserves the formatting of the log and makes it easier for us to read and decipher. DO NOT SKIP THIS STEP!
Thanks ...
That was pretty quick.
I will follow the instructions in the future!
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 25. 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.