SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Iterative run in DI Studio

Reply
Frequent Contributor
Posts: 83

Iterative run in DI Studio

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.

Super User
Posts: 5,434

Re: Iterative run in DI Studio

Take a look at the Loop transformations.

Data never sleeps
SAS Super FREQ
Posts: 708

Re: Iterative run in DI Studio

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
Frequent Contributor
Posts: 83

Re: Iterative run in DI Studio

Posted in reply to Bruno_SAS

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.

Super User
Posts: 5,434

Re: Iterative run in DI Studio

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

Data never sleeps
SAS Super FREQ
Posts: 708

Re: Iterative run in DI Studio

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

Frequent Contributor
Posts: 83

Re: Iterative run in DI Studio

Posted in reply to Bruno_SAS

Thanku very much.

SAS Super FREQ
Posts: 708

Re: Iterative run in DI Studio

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

Ask a Question
Discussion stats
  • 7 replies
  • 533 views
  • 4 likes
  • 3 in conversation