BookmarkSubscribeRSS Feed
nalamalapu_hotmail_com
Calcite | Level 5

Hi,

As of now SAS macro code is running in EG using metadata tables and creating 5 aggregated tables.

I need to automate this SAS macro code in DI studio.to create 5 aggregated tables. This is my requirement.

Can anybody help to get the solution for this. Thanks in advance.

4 REPLIES 4
shivas
Pyrite | Level 9

Hi,

If you want to use the same macro code of EG as it is then you can use user written transformation in SAS DI studio.

Thanks,

Shiva

nalamalapu_hotmail_com
Calcite | Level 5

Thank you Shiva.

Here EG code we are generating 5 aggregated tables.

After using user written transformation in SAS DI studio same 5 aggregated tables will come out automatically.

For this 5 aggregated tables we need only 1 ETL job is enough or 5 ETL's need?


shivas
Pyrite | Level 9

Hi,

Try this code in your user written transformation and try to run the user written transformation you can see two output data sets.or you can design all the logic in ETL jobs and can create 5 ETLs in one single work space or job itself.

%macro test(data ,input);

LIBNAME test BASE "f:\test\DATA";

data test.&data;

set sashelp.class;

where Sex="&input";

run;

%mend test;

%test(male ,M);

%test(female,F);

Thanks,

Shiva

LinusH
Tourmaline | Level 20

Well. it depends on the characteristics of your macro.

if you use macro logic for some kind of looping, you can use the technique described by Shiva, and then, you need just one job (aka ETL).

But if you macro have parameters that is called five times, you van create a job that has input parameters, and then if possible, have an outer job calling the inner job in loop.

Data never sleeps

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1020 views
  • 0 likes
  • 3 in conversation