MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can I compare a field with current date through SORT in JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sharada
Beginner


Joined: 24 Aug 2005
Posts: 32
Topics: 14
Location: Hyderabad

PostPosted: Mon Sep 12, 2005 4:49 am    Post subject: Can I compare a field with current date through SORT in JCL Reply with quote

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
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Mon Sep 12, 2005 5:08 am    Post subject: Reply with quote

Sharada,

Read the following topic which discusses on a similar issue.
http://www.mvsforums.com/helpboards/viewtopic.php?t=1014&highlight=db2

I hope this solves your problem. If not let us know

Thanks,
Phantom
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Sep 12, 2005 5:14 am    Post subject: Reply with quote

sharada,

If you have syncosrt for z/os 1.1 and highter you can subtract 15 days from &date1P to get the desired results.

check this link

http://mvsforums.com/helpboards/viewtopic.php?t=4252&highlight=date

Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Sep 12, 2005 9:46 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
sharada
Beginner


Joined: 24 Aug 2005
Posts: 32
Topics: 14
Location: Hyderabad

PostPosted: Mon Sep 12, 2005 11:09 pm    Post subject: Reply with quote

Hi all,

thank you very much for your time,
every solution given is working.

thanks a lot.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed May 10, 2006 6:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group