My requirement is to get the details from 17 of previous month to 18th of current month . Can you please help me how to get previous month details in SYMNAMES.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
If you don't already have a "calendar file" (dates you need for your system) to generate from, then just generate the symbols you need in a prior step, so you can "calculate" the start of your range.
I got the calendar dates from CURDATE using "SYMNAMES" but am not sure how to calculate the previous month date (PREDATE) PREDATE,S'&LYR4.-&LMON-17'
using "SYMNAME" . Can you please let me know how to achieve the same.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
There are date functions. Those may be the simplest ways to work out month-and-year of previous month. Apply those to your source-date, hard-code the 17/18 (so that it works) and generate the symbols with the values you need for the run.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
We can best help if you show what you tried and the results of that. Input and expected output, and what you got, including error messages (with codes).
What about rerun situations for prior periods or testing scenario.
Always needed eventually.
Always like the run date seeded in a dataset or calendaring dataset as mentioned previously.
Agreed.
When implementing sort parameters with include/omit date dependencies, I like to use symbolic parameters that can be manually configured via set/proc statements (JPn) overrides when needed. Whether this particular solution is meant for production or not, sooner or later you will come across a situation that you'll benefit by building in the JPn feature.
Don't quote me on this as I am not a Syncsort user but I think newer Syncsort releases now support JPn symbolic parameters.
My recommendation for the OP would be to see what release of Syncsort they have, consult the documentation and if available, consider a solution that leverages symbolic parameters.
I'm using SYNCSORT FOR Z/OS 1.4.2.0R. It supports JPn symbolic parameters.
In that case, here is an option for the OP to consider if they also have JPn support in their Syncsort version. I use a variation of this all the time (DFSORT) to convert Gregorian parm dates to Julian dates for comparison.
Code:
// SET BEGDATE='20160101',ENDDATE='20160330'
//*SET BEGDATE='CCYYMMDD',ENDDATE='CCYYMMDD'
//********************************************************
//* GENERATE SYMBOLICS FOR BEGIN & END DATE PARMS
//********************************************************
//STEP0010 EXEC PGM=SORT,PARM=('JP0"&BEGDATE"','JP1"&ENDDATE"')
//SYMNAMES DD DISP=SHR,DSN=&SYMBLIB(SYMCONST)
// DD *
BEG-DAY,'17'
END-DAY,'18'
//SYMNOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD *
CCYYMMDD MMDDCCYY CCYYDDD
//DATEPARM DD DSN=&&S,DISP=(,PASS,DELETE),UNIT=SYSDA,SPACE=(TRK,(1,1))
//DATEPARX DD SYSOUT=*
//SYSIN DD *
OPTION COPY,STOPAFT=1
* EDIT TO SEE IF THERE IS A PARM DATE OVERRIDE,
* OTHERWISE USE CURRENT DATE FOR DEFAULT
* BUILD THE SYMBOLICS USED BY SUBSEQUENT SORT STEPS
*
OUTFIL FNAMES=(DATEPARM,DATEPARX),
BUILD=(C'BEG-DATE,C',Q,01,10,Q,80:X,/,
C'END-DATE,C',Q,11,10,Q,80:X)
/*