Help using Base SAS procedures

How to create a loop?

Reply
Regular Contributor
Posts: 240

How to create a loop?


I have a table that runs daily it gets kick off by task in windows. The issue is that there is a column in table for  date that must be from yesterday its a indicator data has refreshed. When  its not we have to manually kick off the sas code to bring in the most current data. I need help in creating a loop that runs the 1st part of the table an see that date eq yesterday an it proceeds. When it doesn't eq to yesterday day it stops goes to sleep for 30min an reruns script until date matches yesterday date...Thanks for assistance

Respected Advisor
Posts: 3,777

Re: How to create a loop?

Your question contains the answer SLEEP.

SAS(R) 9.3 Functions and CALL Routines: Reference

Regular Contributor
Posts: 240

Re: How to create a loop?

Thanks for the quick reponse. I would like the loop to look to see if the settlement date matches yesterday. If it does than the rest of the  code runs. If it doesn't match yesterday date than it  stops  an starts the process over again until settlement day matches yesterday day.

Respected Advisor
Posts: 3,777

Re: How to create a loop?

Those details are specific to your data.  What is "settlement data" and where is it, etc.   You will need to supply more details for me.  Others may be able to devine the question without knowing the answer. :-)

Regular Contributor
Posts: 240

Re: How to create a loop?

The table has a.Col name Settlement date it's formatted in mmddyy. What I want to have is a loop that looks at the 1st entry an if the settlement date. Matches yesterday date to contiune running script. If it doesn't eq to yesterday date it stops script .  I would want it to start process again until the settlement matches yesterday day... Thanks again

PROC Star
Posts: 7,356

Re: How to create a loop?

The following thread shows some code that is quite close to what you want/need to do:

Ask a Question
Discussion stats
  • 5 replies
  • 222 views
  • 0 likes
  • 3 in conversation