BookmarkSubscribeRSS Feed
smm662002
Quartz | Level 8

Hello,

I have created three macro variables (presented bellow) and save the code in a process flow named AutoExec. I have tried to use these macro variables in a diffrent process flow in a querry builder and I had an error message (both process flows were part of the same project).

Is there a way to transfer macro variables between diffrent process flows (without using prompts)?

Is there a way to use Prompts  to achieve the same results as the code I have bellow?

data _null_;

     Extract_start=intnx('month',today(),-1,'b');

     Extract_end=intnx('month',today(),-1,'e');

     call symput('Date_RPT_From',put(Extract_start,date9.));

     call symput('Date_RPT_To',put(Extract_end,date9.));

     call symput('RunDate',put(today(),date9.));

run;

Thank you,

Madalin

2 REPLIES 2
LinusH
Tourmaline | Level 20

What was the error?

And how are you using the macro variables?

You need to run the autoexec before the query builder executes.

Data never sleeps
smm662002
Quartz | Level 8

Hi,

Thank you for your answer.

Please find bellow the log extract, including the error. 

I have tried to use the macro variable in a query builder.

You have mentioned that I have to run the autoexec before the query builder executes. Can you please tell me more about this?

PROC SQL NOEXEC;

4 SELECT t1.Table

5 FROM MBMNTHM0.MCLAIM t1

6 WHERE t1.DATE >= &Date_RPT_From;

_

22

WARNING: Apparent symbolic reference DATE_RPT_FROM 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.

Thank you,

Madalin

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 950 views
  • 0 likes
  • 2 in conversation