Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need help in sorting a Date field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rajeshwarch

New User


Joined: 24 Mar 2008
Posts: 29
Location: mumbai

PostPosted: Wed May 20, 2009 6:27 pm    Post subject: Need help in sorting a Date field
Reply with quote

Hi everybody,
I have Date of birth in filed position 20:8, and effective date field in position 30:8 both are in yyyymmdd format. My requirement is that check the effective date field value, whether it is in range of current year Date of birth to (current year date of birth - 12 months).

For example DOB having value 20071231, we have to check the Effective date field is in range of 20081231 to 20091231.
Help me to write sort card for this.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed May 20, 2009 8:32 pm    Post subject:
Reply with quote

Your description is rather unclear. Please show an example of the records in the input file for various combinations of the two date fields and what you expect for output. Give the RECFM and LRECL of the input file.

Is the range you want to use DOB yyyymmdd to DOB zzzzmmdd where zzzz=yyyy+1 or is it something else? Please be specific.
Back to top
View user's profile Send private message
rajeshwarch

New User


Joined: 24 Mar 2008
Posts: 29
Location: mumbai

PostPosted: Thu May 21, 2009 5:23 pm    Post subject:
Reply with quote

Hi Frank Yaeger,
Here are some sample input
DOB EFF. dt
xxxxxxxxxxxxxxxxxxx20071231xx20091001xxx rec1
xxxxxxxxxxxxxxxxxxx20071001xx20080901xxx rec2
xxxxxxxxxxxxxxxxxxx20070101xx20081201xxx rec3
xxxxxxxxxxxxxxxxxxx20070510xx20080101xxx rec4
xxxxxxxxxxxxxxxxxxx20070110xx20071231xxx rec5

out put file will have only rec1, rec3.
Becoz incase of Rec1 the Eff. dt 20091001 is in the range of 20081231 to 20091231 and
in case of Rec3 the Eff.dt 20081201 in the range of 20080101 to 20090101.

The file having LRECL= 40. dob is in position 20:8 and eff.dt in position 30:8.

I hope this will give you clear picture about my requirement
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Thu May 21, 2009 5:53 pm    Post subject:
Reply with quote

On what basis you are checking the effective date between the dates you have mentioned?

I beleive, for first record, DOB is 20071231(YYYYMMDD) so you are checking between 20081231(YYYY+1 and MMDD of DOB) and 20091231(YYYY+2 and MMDD of DOB). That means, you are checking Effective Date between YYYY+1 (of DOB) and YYYY+2 (of DOB) dates. is this correct?

If you are expecting correct reply, explain all the conditions properly. Above is my guess, others may have some other guess also. so, please try to explain everything clearly.
Back to top
View user's profile Send private message
rajeshwarch

New User


Joined: 24 Mar 2008
Posts: 29
Location: mumbai

PostPosted: Thu May 21, 2009 7:28 pm    Post subject:
Reply with quote

Quote:
you are checking Effective Date between YYYY+1 (of DOB) and YYYY+2 (of DOB) dates. is this correct?


Yes, what you assumed is correct
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu May 21, 2009 9:38 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/40)
//SORTOUT DD DSN=...  output file (FB/40)
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(41:20,4,ZD,ADD,+1,EDIT=(TTTT),45:24,4,
                 49:20,4,ZD,ADD,+2,EDIT=(TTTT),53:24,4)
  OUTFIL INCLUDE=(30,8,ZD,GE,41,8,ZD,AND,30,8,ZD,LE,49,8,ZD),
    BUILD=(1,40)
/*
Back to top
View user's profile Send private message
rajeshwarch

New User


Joined: 24 Mar 2008
Posts: 29
Location: mumbai

PostPosted: Fri May 22, 2009 6:21 pm    Post subject:
Reply with quote

Thanks alot yaeger its working fine... icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us