BookmarkSubscribeRSS Feed
tommy81
Obsidian | Level 7

Hi ,

I need to run a job automatically for 10 years in DI studio with out any manual intervention.

Following vars will be used as parameters to be passed 1)  &YEAR_BEG_DAY  2) &YEAR_END_DAY derived from below.

DATA _NULL_;

CALL SYMPUT("YEAR_BEG_DAY",put(INTNX("YEAR",Today(),-1,'B'),DATE9.));/*FIRST DAY OF THE YEAR*/

CALL SYMPUT("YEAR_END_DAY",put(INTNX("YEAR",Today(),-1,'E'),DATE9.));/*LAST DAY OF THE YEAR*/

RUN;

I need to know how this could be done in DI studio. 

I`ve 2 jobs actually.

Job 1 will fetch 1 year data truncate and load  Table 1  and  Job 2 will do some transformations and Load another FINAL table  (Append)

Again this has to be repeated for another 9 years.

Can we actually do it in a single go and should this be better manually.

7 REPLIES 7
LinusH
Tourmaline | Level 20

Take a look at the Loop transformations.

Data never sleeps
BrunoMueller
SAS Super FREQ

SAS Data Integration Studio provides a loop transformation that can help with this.

Basic Steps:

  • create a job for the "detail" work, add parameters to the job (using job properties) the parameter values will be available as Macro variables so they can be used anywhere
  • create the control job with the loop transformation that will provide the parameter values to the "detail" job
tommy81
Obsidian | Level 7

Thats a great option.

Also just wanted to know if we could add a second job adjacent to the first one with out using the any of the loop parameters.

LinusH
Tourmaline | Level 20

Lop parameters are optional, if you don't map them, they are not used.

Data never sleeps
BrunoMueller
SAS Super FREQ

You can add a Job either after the Loop End transformation or within the loop, see also picture below.

Capture.PNG

If the job does not have any parameter it will do its work for each iteration of the loop

tommy81
Obsidian | Level 7

Thanku very much.

BrunoMueller
SAS Super FREQ

Please mark the answers as "helpful" or "correct" this will help others too

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to connect to databases in SAS Viya

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.

Discussion stats
  • 7 replies
  • 1335 views
  • 4 likes
  • 3 in conversation