Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 355
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 Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us