IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need help in sorting a Date field


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Wed May 20, 2009 8:32 pm
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
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: 355
Location: New York

PostPosted: Thu May 21, 2009 5:53 pm
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
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 Developer


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

PostPosted: Thu May 21, 2009 9:38 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Need to convert date format DFSORT/ICETOOL 20
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top