I want to create one variable called DESCRIPTION which should have the value as description of the Job. Assume one Job is calculating weight of the student and it is mentioned in the description of the Job, then I need the value as "weight of the student" in a variable DESCRIPTION.
I already checked the generated code of the DIS Jobs and no Job holds the value of the description of the Job in any macro variable neither it don't seem to be stored any where.
Appriciate if someone of you shed some light on this exercise.
Full points that you first inspected the DIS generated code to see what's available. You might have seen that DIS creates macro variable &JobID. Using this macro variable the following should work.
data _null_;
length Description $256;
rc=metadata_getattr("OMSOBJ:Job?@Id = '&jobID'","Desc",Description);
call symputx('Description', Description);
put rc=;
put Description=;
stop;
run;
%put &=Description;
Above based on docu sample code from here:
And to figure out the attribute names for a metadata object refer to documentation here:
https://support.sas.com/documentation/cdl/en/omamodref/67417/HTML/default/viewer.htm#job.htm
Querying SAS Metadata is often not that simple. Luckily here we just had to get the attribute of an object where we knew the Id already.
Full points that you first inspected the DIS generated code to see what's available. You might have seen that DIS creates macro variable &JobID. Using this macro variable the following should work.
data _null_;
length Description $256;
rc=metadata_getattr("OMSOBJ:Job?@Id = '&jobID'","Desc",Description);
call symputx('Description', Description);
put rc=;
put Description=;
stop;
run;
%put &=Description;
Above based on docu sample code from here:
And to figure out the attribute names for a metadata object refer to documentation here:
https://support.sas.com/documentation/cdl/en/omamodref/67417/HTML/default/viewer.htm#job.htm
Querying SAS Metadata is often not that simple. Luckily here we just had to get the attribute of an object where we knew the Id already.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.