BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Spiky123
Calcite | Level 5

Hi !

I have a problem. I want to do a LOOP on SAS Data Integration Studio and execute this Loop until the value in my table is equal 1.

For example :

Capture.PNGThe user writer code generate a variable "file_test" in the table work.test

I want to make a LOOP with the LOOP transformation (no user writer code) to execute the loop until the value of "file_test" equal 0 and if the value of "file_test" = 1 then stop the LOOP.

Is it possible ?

The version of SAS DIS is 4.9

 

Thanks 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20
This sounds more like a job for a scheduler or an external script.
DI Studio is mainly for dealing with data flows, not application logic.
Data never sleeps

View solution in original post

4 REPLIES 4
LinusH
Tourmaline | Level 20
Spontaneously I would say no, that's not how the loop transform works.
A dirty solurion is to wrap the steps in the inner job with a surronding macro with %do and %while/%until.
If you describe the logic how you assign the file_test we might can come up with a neater solution.
Data never sleeps
Spiky123
Calcite | Level 5

Hello LinusH,

 

First of all thanks for your reply ! Smiley Happy

 

The operation of the process is as follows:


The DIS job should run every 5 minutes by searching a directory for a specific file.
The macro loops as long as the file is not found. If the file is found, it stops.
How can I set up a condition in my program that runs the DIS job every 5 minutes to check for the presence of the file and does not run after the file is found?

I can use the USER WRITER transformation, as you said the LOOP transformation doesn't work for this.

Best regards,

LinusH
Tourmaline | Level 20
This sounds more like a job for a scheduler or an external script.
DI Studio is mainly for dealing with data flows, not application logic.
Data never sleeps
Spiky123
Calcite | Level 5

Super !! you confirm all iwas thinking :)))

Thanks a lot 🙂

 

Best regards,

Stefan

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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