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,

 

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

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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!

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

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!

--
Paige Miller
Debugger
Fluorite | Level 6

Thanks ...

That was pretty quick.

 

I will follow the instructions in the future!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 19557 views
  • 0 likes
  • 2 in conversation