Jump to content

Looking to see if there is a best practice for using ReportC...


Chad Smith

Recommended Posts

Looking to see if there is a best practice for using ReportCaster to run a fex 7 days before the end of the month.

Traditionally we setup ReportCaster to run the fex multiple days in a row and instruct the code to bypass the output if the run date is not 7 days from the end of the month. On the one day out of the month where the condition is met, a report is distributed to the requestor.

Is there a better way to do this by strictly using ReportCaster to make the decision to run or not It seems overkill to run it several days in a row.

Thanks for any suggestions you can offer.

Link to comment
Share on other sites

Another way it to use a pre-processing fex. The 7th day before the end of the month will be one of the following:

 

the 21st in Feb or 22nd in a Leap Year.

the 24th of Jan, Mar, May, Jul, Aug, Oct or Dec

the 23rd of Apr, Jun, Sep or Nov

 

Set the job in RC to run on the 21st, 22nd, 23rd and 24th.

In the pre-processing fex see if the run date is the 7th day befor the end of the month (lots of ways to do this). If it is allow the job to run. If not, set the &&KILL_RPC to Y and the job will stop. The only catch is if the job has multiple tasks, you have to do the pre-processing fex before every task. (Ive had a NFR in for this for about 5+ years).

We do this a lot. We have jobs that run on a given Business day of the Month which takes into account weekends and holidays.

Link to comment
Share on other sites

Create schedule to run everyday.

In the pre-processing add the functionality to get the current date ,get the end of month then find the difference .

-SET &DT_CURR = &YYMD;

-SET &DT_EOM = DATECVT(DATEMOV(DATECVT(&DT_CURR,I8YYMD,YYMD),EOM),YYMD,I8YYMD);

-SET &DIFF_DT=DATEDIF(&DT_CURR,&DT_EOM,D);

 

-TYPE &DT_CURR

-TYPE &DT_EOM

-TYPE &DIFF_DT

-SET &MESSAGE=IF &DIFF_DT LT 7 THEN Run ELSE do not run;

-TYPE &MESSAGE

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...