View previous topic :: View next topic
|
Author |
Message |
rajeshwarch
New User
Joined: 24 Mar 2008 Posts: 29 Location: mumbai
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
rajeshwarch
New User
Joined: 24 Mar 2008 Posts: 29 Location: mumbai
|
|
|
|
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 |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
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 |
|
|
rajeshwarch
New User
Joined: 24 Mar 2008 Posts: 29 Location: mumbai
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
rajeshwarch
New User
Joined: 24 Mar 2008 Posts: 29 Location: mumbai
|
|
|
|
Thanks alot yaeger its working fine... |
|
Back to top |
|
|
|