BookmarkSubscribeRSS Feed
vandhan
Fluorite | Level 6

Hello,

 

I am working on some comparing datasets and wanted to make sure compare program using the correct datasets. 

 

EX: my program name is A. I want to compare A dataset with AA. But issue arised here is programmer compared B with BB and compare report showing all matched in program A.

 

I wanted to make sure in A program they compared only A dataset with AA.

 

so I wanted mitigation plan here and load program (A) name into pgm macro variable in A program. and call pgm macro variable as input dataset in compare setp.

 

Please help.  

7 REPLIES 7
Kurt_Bremser
Super User

It depends on the way you run your program.

In batch mode, there is a macro variable SYSPROCESSNAME that you can use.

From EG, you can see the current node name from within the project tree as _CLIENTTASKLABEL.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

What software are you using, e.g. Base, Enterprise Guide etc.  How do you call the proc compare?  Surely you would have a paramter from that you can use?

%comp (inds=abc,compds=abcd);
  title "Dataset=&inds.  Comp=&Comp.";
...

Need some information to proceed.

vandhan
Fluorite | Level 6
I am using EG only. i wanted to load A value to inds macro variable in this case.
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Please present an example of what you mean, show some code, show what you want to see.

vandhan
Fluorite | Level 6
I have program name ABC. I want to create a macro variable name PGM and it should have a value ABC. Do we have any system option or automatic macro variable for that?
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well in Base there is:

http://support.sas.com/kb/24/301.html

 

Don't know if that works in EG.  Why should the filename drive parameter though?  Would it not be better to generalise the compare and use paramters.

Kurt_Bremser
Super User

@vandhan wrote:
I have program name ABC. I want to create a macro variable name PGM and it should have a value ABC. Do we have any system option or automatic macro variable for that?

Look at the log as returned to EG. You'll find the variables created by EG right at the top:

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='mytest';
4          %LET _CLIENTPROJECTPATH='';
5          %LET _CLIENTPROJECTNAME='';
6          %LET _SASPROGRAMFILE=;

With EG after 7.13 (or 7.13 with a hotfix applied), _SASPROGRAMFILE will also be populated.

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 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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 3492 views
  • 1 like
  • 3 in conversation