| Author |
Message |
anjanav
New User
Joined: 07 Mar 2007 Posts: 1 Location: NY
|
|
|
|
Hi,
I need to get from a particular Input sequential File of length 350, the records which have not been updated for last 6 months from current date.The update Timestamp is in position 224 to 249.
ie i need to know if UPDT-TIMESTAMP(1:10) > 6 months frm run date.
Is there anyway i can do it using a DFSORT? I went through material but could not figure how to do DATE1 - 6months?
Appreciate your help in this.
Have a good day.
Thanks. |
|
| Back to top |
|
 |
References
|
Posted: Wed Mar 07, 2007 7:44 pm Post subject: Re: How to get a future date with Syncsort |
 |
|
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 3777 Location: San Jose, CA
|
|
| Back to top |
|
 |
Shanthi Jayaraman
New User
Joined: 11 Jun 2007 Posts: 7 Location: Malaysia
|
|
|
|
Dear All,
I am trying to get future/previous date with the below code but getting abend as syntax error :
| Code: |
//S010 EXEC PGM=ICEMAN
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=XXX.PARMLIB(DTEPRM),DISP=SHR
//SORTOUT DD DSN=XXX.PARMLIB(DTEPRM),
// DISP=SHR,SPACE=(TRK,(1,1)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1,8,DATE1+1,80:X)
/*
//* |
| Code: |
SYSIN :
SORT FIELDS=COPY
OUTREC BUILD=(1,8,DATE1+1,80:X)
*
WER268A OUTREC STATEMENT : SYNTAX ERROR |
|
|
| Back to top |
|
 |
Moved: Thu May 08, 2008 11:38 am by dick scherrer From DFSORT/ICETOOL to JCL |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 5923 Location: 221 B Baker St
|
|
|
|
Hello,
You are using Syncsort rather than DFSORT.
What version of Syncsort are you running? The version is shown near the top of the information printed when you execute the sort. |
|
| Back to top |
|
 |
Shanthi Jayaraman
New User
Joined: 11 Jun 2007 Posts: 7 Location: Malaysia
|
|
|
|
The version is :
SYNCSORT FOR Z/OS 1.2.1.0R
It doesn't work with SyncSort? |
|
| Back to top |
|
 |
arcvns
Active User
Joined: 17 Oct 2006 Posts: 200 Location: Trivandrum, Kerala
|
|
|
|
It works with syncsort as well.
| Code: |
//SORTIN DD *
20080501
20080502
20080503
20080509
20080510
//*
//SORTOUT DD SYSOUT=*
//*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,8,CH,LE,&DATE1-3)
/*
|
Output
| Code: |
20080501
20080502
20080503
|
Thanks,
Arun |
|
| Back to top |
|
 |
Shanthi Jayaraman
New User
Joined: 11 Jun 2007 Posts: 7 Location: Malaysia
|
|
|
|
It still doesn't work for me.
No changes on the sortout file although the abend doesn't happen anymore.
My requirement is I need to dynamically create the parm with the date values depending on when the job will be executed. If it is after 12AM, then I need to get the previous date in CCYYMMDD format. |
|
| Back to top |
|
 |
sril.krishy
Active User
Joined: 30 Jul 2005 Posts: 135 Location: hyderabad
|
|
|
|
Shanthi Jayaraman,
The arcvns card is working fine.Please note that you can olny use the &date with INCLUDE/OMIT conditions.I think ,to achive the final results as you are expecting,you need to have a turn around method.
Thanks
Krishy |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 5923 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| It still doesn't work for me. |
I'd suggest you run the test exactly as it is posted. Until you can get the proven test to work on your system, there is no need to try for your version.
Please reply here if the test will work or will not work. We can proceed from there. If it does not work, post the jcl, control statements, the file output, and the queued output from the run. |
|
| Back to top |
|
 |
arcvns
Active User
Joined: 17 Oct 2006 Posts: 200 Location: Trivandrum, Kerala
|
|
|
|
Hi all,
My earlier post was to compare a date field with an offset of current date. If you are trying to create a future date (say current date+1 ), try out this synctool job.
| Code: |
//STEP1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*
//INFILE DD *
ABC
//*
//TEMP DD DSN=&&T1,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUTFILE DD SYSOUT=*
//TOOLIN DD *
COPY FROM(INFILE) TO(TEMP) USING(CTL1)
COPY FROM(TEMP) TO(OUTFILE) USING(CTL2)
//*
//CTL1CNTL DD *
INREC FIELDS=(1,3,&DATE3)
SORT FIELDS=COPY
/*
//CTL2CNTL DD *
INREC FIELDS=(1,3,6,5,ZD,ADD,+100001,TO=PD,LENGTH=4)
SORT FIELDS=COPY
OUTREC FIELDS=(1,3,4,4,DT1)
/*
|
You can increment the value '+100001' in order to get different offsets.
e.g., '+100002' to get current date + 2.
Thanks,
Arun |
|
| Back to top |
|
 |
|
|