View previous topic :: View next topic |
Author |
Message |
sharada Beginner
Joined: 24 Aug 2005 Posts: 32 Topics: 14 Location: Hyderabad
|
Posted: Mon Sep 12, 2005 4:49 am Post subject: Can I compare a field with current date through SORT in JCL |
|
|
Hi,
Can we compare current date with a field
in a record using SORT?
HERE IS MY PROBLEM IN DETAIL
I have a file with the following lay out.
01 REC-LAYOUT.
05 FIELD1 x(2).
05 FILLER x(1).
05 FIELD2 x(8).
FIELD2 is a date field with the format CCYYMMDD, it contains some valid date.
Example:
AA 20050812
BB 20050410
DD 20050909
FF 20050910
EE 20050831
CC 20040101
I want to sort this file based on FIELD1,
and want to include only those records which are having
date field(FIELD2) not more than 15 days from the current date.
The output file should look like this
DD 20050910
EE 20050831
FF 20050910
Note: I am posting this on september 12th 2005 (20050912)
Can I do this through SORT in JCL? |
|
Back to top |
|
|
Phantom Data Mgmt Moderator
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Sep 12, 2005 9:46 am Post subject: |
|
|
sharada,
If you have DFSORT, see the "Include records using relative dates" Smart DFSORT Trick at:
http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Last edited by Frank Yaeger on Mon Sep 11, 2006 6:30 pm; edited 1 time in total |
|
Back to top |
|
|
sharada Beginner
Joined: 24 Aug 2005 Posts: 32 Topics: 14 Location: Hyderabad
|
Posted: Mon Sep 12, 2005 11:09 pm Post subject: |
|
|
Hi all,
thank you very much for your time,
every solution given is working.
thanks a lot. |
|
Back to top |
|
|
Frank Yaeger Sort Forum Moderator
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Wed May 10, 2006 6:43 pm Post subject: |
|
|
z/OS DFSORT V1R5 PTF UK90007 and DFSORT R14 PTF UK90006 (April, 2006) now provides built-in functions for relative dates like the current date - 1 day or the current date + 30 days. See the following for complete details on using past date constants and future date constants.
www.ibm.com/servers/storage/support/software/sort/mvs/peug/ _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
|
|
|