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

I want to create one macro variable called 'LIBRARY' which I want to use it to the next step to query the permanent table. Assume I've a Job Name as below.

 

%let etls_jobName = IF_04_J_PRT_TRA_INSURANCE_RECORD_DELIVERY;

or

%let etls_jobName = IF_04_J_PRC_TRA_INSURANCE_RECORD_DELIVERY;

or

%let etls_jobName = IF_04_J_PRT_LOA_INSURANCE_RECORD_DELIVERY;

or

%let etls_jobName = IF_04_J_PRC_LOA_INSURANCE_RECORD_DELIVERY;

 

And

 

If the Job Name contains PRT_TRA then I want the macro variable to resolve to IFPRTEXT

If the Job Name contains PRC_TRA then I want the macro variable to resolve to IFPRCEXT

If the Job Name contains PRT_LOA then I want the macro variable to resolve to IFPRTTRA

If the Job Name contains PRC_LOA then I want the macro variable to resolve to IFPRCTRA

 

I never created the macro variable with some conditions. Appericiate if someone of you shed some light on this.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Example:

 

data _null_;
    if find("&etis_jobname",'PRT_TRA')>0 then call symputx('library','IFPRTEX');
    /* additional if statements here as needed */
run;
--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

Example:

 

data _null_;
    if find("&etis_jobname",'PRT_TRA')>0 then call symputx('library','IFPRTEX');
    /* additional if statements here as needed */
run;
--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 405 views
  • 1 like
  • 2 in conversation