BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sanalitics
Obsidian | Level 7

Is there a way the macro created @ autoexec.sas , say for example %let test_macro=TEST could be called/referred in DataFlux?

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

@sanalitics 

As I understand it a DataFlux server is independent from SAS servers. They sit side by side. 

A SAS Autoexec gets executed during SAS invocation. It's part of your SAS environment configuration. DataFlux got its own configuration files.

You've got integration points between SAS and DataFlux. I don't know if that's possible but you would need to call a SAS job or service out of DataFlux which returns the value of the SAS macro variable back to DataFlux (like: Build a SAS service which you can call via HTTP request and which returns the value of the SAS macro variable back to DataFlux).

 

If the SAS and DataFlux Server are on the same machine then an alternative option could be: Define an environment variable on OS level which is accessible by both SAS and DataFlux.

 

But then: May be it's just best if you define this variable independently in the SAS and the DataFlux configuration and then make it a documented admin task for keeping it in sync. Such configuration values shouldn't really have to change once defined. That's the option I'd be going for unless there is a very compelling reason for doing something more complex.

View solution in original post

9 REPLIES 9
ChrisLysholm
SAS Employee

Hello,

 

Can you tell me which DataFlux product or products you want to be able to refer these global macro variables in?

Would this be DataFlux Data Management Studio, and more specifically, the SAS Code Node and or SAS Code (Reference) Node?

 

I am not a DataFlux product expert but will attempt to help you.

sanalitics
Obsidian | Level 7

Thanks for responding Chris:

 

Following are the details:

 

I am using DataFlux Data Management Studio

To be more clear... I have created a global variable in autoexec.sas , so I have this macro variable available in every session of the Data Integration Studio.... how could I get the value of this global variable in every session of DF . Is there a way macro variable could be shared between SAS BI and DF?

 

Thanks,

Sandeep

ChrisLysholm
SAS Employee

OK, thanks for the additional information.

 

I am not a DataFlux expert, but I do know that each time the SAS Code Node executes it starts a new SAS session on the defined workspace server. When the SAS Code Node completes this session is terminated. Perhaps an autoexec.sas file could be defined that will execute with each SAS session that is started by the SAS Code Node. Another approach might be to store macro variable/value pairs in a sas dataset and then read those values in a data step and execute the required %let macro variable declarations all within the SAS Code Node.

 

 

sanalitics
Obsidian | Level 7

Thanks Chris, but this is a way to create a macro in SAS code node... but I want a solution to get the same macro value in DF

Patrick
Opal | Level 21

@sanalitics 

If you call the DF job out of SAS using function DMSRVBATCHJOB() then you can pass in any number of parameters as key/value pairs.

http://support.sas.com/documentation/cdl/en/dqclref/70016/HTML/default/viewer.htm#n16n5k2yshx25bn122... 

 

I'm not the DF expert so can't tell you what needs to be done on the DF side to receive these parameters. But I've been in a project where this has been done so I know it works.

sanalitics
Obsidian | Level 7

Hi Patrick,

 

Thanks for the response... Kindly find more information on my ticket in the above post.

In fact... i don't want to call any service in DF, instead I would like to get the value  of macro variable defined @ Autoexec.sas into DF 

 

Best Regards,

Sandeep

 

Patrick
Opal | Level 21

@sanalitics 

As I understand it a DataFlux server is independent from SAS servers. They sit side by side. 

A SAS Autoexec gets executed during SAS invocation. It's part of your SAS environment configuration. DataFlux got its own configuration files.

You've got integration points between SAS and DataFlux. I don't know if that's possible but you would need to call a SAS job or service out of DataFlux which returns the value of the SAS macro variable back to DataFlux (like: Build a SAS service which you can call via HTTP request and which returns the value of the SAS macro variable back to DataFlux).

 

If the SAS and DataFlux Server are on the same machine then an alternative option could be: Define an environment variable on OS level which is accessible by both SAS and DataFlux.

 

But then: May be it's just best if you define this variable independently in the SAS and the DataFlux configuration and then make it a documented admin task for keeping it in sync. Such configuration values shouldn't really have to change once defined. That's the option I'd be going for unless there is a very compelling reason for doing something more complex.

sanalitics
Obsidian | Level 7

Hi Patrick,

"Build a SAS service which you can call via HTTP request and which returns the value of the SAS macro variable back to DataFlux)"

should solve the problem...Let me know if you could send a good link which directs me to the process to call a SAS services from Dataflux... and also I think SAS should look into integrating both DF and SAS services to solve so many such issues ....

 

 

 

Best Regards,

Sandeep

 

Patrick
Opal | Level 21

@sanalitics 

"Let me know if you could send a good link which directs me to the process to call a SAS services from Dataflux."

I'm not a DF expert but it appears there is a HTTP node

http://support.sas.com/documentation/onlinedoc/dfdmstudio/2.7/dmpdmsug/Content/dfDMStd_HTTP_Request.... 

 

Of course to call a web service it must exist. So first thing you need to do is create such a web service on the SAS side. Here links a found with a bit of Googling"

https://support.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/1937-2018.pdf 

http://support.sas.com/kb/60/964.html 

 

"... and also I think SAS should look into integrating both DF and SAS services to solve so many such issues ...."

If you have suggestions for a better integration then put it here as an idea: https://communities.sas.com/t5/Community-Suggestion-Box/idb-p/community_ideas 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 1849 views
  • 0 likes
  • 3 in conversation