BookmarkSubscribeRSS Feed
theRabbitHole
Calcite | Level 5

I have some macro variables which need to be incorporated across multiple jobs.

Basically, a macro in DI Studio.

My initial solution: Creating a new transformation containing the code, e.g.

data _null_;
   set DSET;
   call symput('DATEVAR1 ', put(DATEVAR1 , 8.));
run;

However, when I add the transformation to a job, it does not retain the code.

The Code tab is empty.

Is there a different way of doing ? Would prefer a transformation, which will be available to other users as well.

DI Studio 4.904

OS: Win Server 2016

3 REPLIES 3
a20121248
Obsidian | Level 7

Make sure you are creating the macro variable in that node. Also try using symputx instead of symput.

Check the value in that node:

%put &=DATEVAR1;

 

Not sure if it helps for you case, but there is a parameter tab with many, many options:

1.1. For a particular job:

a20121248_0-1664607654781.png

1.2. In any transformation of that job:

a20121248_1-1664607762746.png

 

 

Patrick
Opal | Level 21

I can't remember ever having had such an issue with a custom transformation. What I would do in such a case using DIS:

  1. Close all jobs
  2. Export your custom transformation (.spk)
  3. Delete the custom transformation
  4. Open a DIS job that used the custom transformation 
    1. To ensure you're not using a "duplicate". The custom transformation shouldn't be in the job anymore.
  5. Import the .spk
    1. In my experience such an export/delete/import approach can fix some metadata hiccups
  6. Add the custom transformation back to the job
  7. Check in the code tab of the job if you can see the custom transformation code as desired
    1. If you can see it save the DIS job, close it, open it again, check again in the code. If still there then you should be fine.

If above still doesn't resolve your issue then I'd check if it's an issue with your DIS job or with the custom transformation by:

  1. Create a new DIS job, add the custom transformation, check if that generates the desired code (after save/close/reopen the DIS job). 
    1. If it doesn't create the desired code then I'd delete the custom transformation and create a new one from scratch
    2. If it does create the desired job then I'd export/delete/reimport the DIS job with the custom transformation as this might fix things (just the job without the dependent objects).

...and if all of the above doesn't help then I'd contact SAS Tech Support

 

 

 

 

 

LinusH
Tourmaline | Level 20

Of course you can try out the trouble shooting suggestions in this thread.

But since this data doesn't seem to have any direct impact of you data flow (lineage), you could either create an actual macro, and call that in your jobs pre-code.

Or, if you bu multiple jobs mean almost all jobs, execute the code in the autoexec.

Data never sleeps

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
  • 3 replies
  • 1010 views
  • 0 likes
  • 4 in conversation