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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 7 replies
  • 2936 views
  • 1 like
  • 3 in conversation