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.
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.
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.
Please present an example of what you mean, show some code, show what you want to see.
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.
@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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.