AnsweredAssumed Answered

Is there an Automic alternative to ESP gentime function

Question asked by GJG on Dec 6, 2018
Latest reply on Dec 7, 2018 by GJG

My shop is converting from CA ESP to CA Automic.

 

ESP provided a GENTIME function that is used to create customized date and/or time symbolic variables.

https://docops.ca.com/ca-workload-automation-esp-edition/11-4/en/reference/commands/gentime-command-generate-times

 

For example, there's a JCL that contains variable !PMOMMM

//JSTEP010 EXEC PGM=SORT

//SORTIN   DD  DSN=PLST.MST.LST.HISTORY.ACT.D(0),

//             DISP=SHR

//SORTOUT  DD  DSN=PLST.PRM.LST.HISTORY.Y2018.!PMOMMM.(+1),

//             DISP=(NEW,CATLG,DELETE),

//             LRECL=1754,

//             RECFM=VB,

//             UNIT=VTS,

//             RETPD=1460,

//             VOL=(,,,10)

//SYSOUT   DD  SYSOUT=*

//SYSIN    DD  *

MERGE FIELDS=COPY

RECORD TYPE=V,LENGTH=(1754,,,150)

 

ESP would use GENTIME to resolve the variable

GENTIME PMO TODAY LESS 10 DAYS

 

So if the job was submitted on December 6th, the variable would resolve to NOV

i.e. PLST.PRM.LST.HISTORY.Y2018.NOV(+1),

 

If the job was submitted on December 12th, the variable would resolve to DEC

i.e. PLST.PRM.LST.HISTORY.Y2018.DEC(+1),

 

I have an include object with the following to get the first three letters of the month:

:SET &AMONTH# = GET_VAR(VARA.MONTHS,&AMM#)
:SET &PMOMMM# = STR_CUT(&AMONTH#,1,3)

 

It's getting the month from VARA.MONTHS

 

Where I'm struggling is how to incorporate code that would determine the month based on the current date minus 10 days.

 

Does anyone have ideas on how I can accomplish this in Automic?

 

Thanks!

 

 

Outcomes