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: Call for Content

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!

Submit your idea!

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