View previous topic :: View next topic
|
Author |
Message |
sabarikanth
New User
Joined: 07 Jun 2010 Posts: 59 Location: coimbatore
|
|
|
|
Hi
I have to compare a date field and have to eliminate if it is greater than 90 days.
How could i achieve this?
i have to use syncsort.
Input:
I have my date field like 'yymmdd' in 65th position
example:
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
001192400 000000070 99216928 110618
001192400 000000070 99216928 110216 |
i used to eliminate by using the below code:
Step1:
I first used the below code and created a Temp file with the 90 days older date at the last.
Code: |
OUTREC BUILD=(1,70,71:DATENS(YMD)-90)
INCLUDE COND=(65,6,CH,LE,71,6,CH)
SORT FIELDS=COPY |
Step2:
then i used outrec build option to obtain my desired output with LRecl=70.
but I'm not getting the correct output in the first step:(
Help me.. IF there is any other option to achieve this simpler..?
Thanks,
Sab. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
but I'm not getting the correct output in the first step:(
Help me.. IF there is any other option to achieve this simpler..? |
Okay, you are telling us NOTHING and expect us to help you -- getting impatient if it is not fast enough, too? You need to learn how to ask a question and what patience is. This is a voluntary forum -- people answer when and if they have time to do so; if you need a fast answer you should pay a consultant who can give you fast answers.
When you say you are not getting the correct output, do you mean:
1. you are getting no output at all?
2. the job is abending with some system abend code?
3. the job is abending with some user abend code?
4. you are getting output but it does not include all the records you expected?
5. you are getting output but it includes records you did not expect?
6. you are getting message from Syncsort that indicate a problem?
7. something else enitrely -- which you didn't bother to explain?
The usual request is to use the Code tag to paste some sample data records and the expected output from those sample records -- which allows us to verify you have correctly stated what you want done. |
|
Back to top |
|
|
sabarikanth
New User
Joined: 07 Jun 2010 Posts: 59 Location: coimbatore
|
|
|
|
Robert:
Quote: |
Okay, you are telling us NOTHING and expect us to help you -- getting impatient if it is not fast enough, too? You need to learn how to ask a question and what patience is |
I didnt mean you are Nothing. Just a help would be valuable. Stay cool.
Input:
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
001192400 000000070 99216928 110618
001192400 000000070 99216928 110518
001192400 000000070 99216928 110216
001192400 000000070 99216928 110128
001192400 000000070 99216928 100922
|
Output
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
001192400 000000070 99216928 110618
001192400 000000070 99216928 110518
|
the last 3 records should be eliminated but i get those records also in my output.
Actually they should be eliminated since those are 90 days older.
The code which i used has been already given. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
what is the date in position 71-76 after the calculation ?
Gerry |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
something to note, INCLUDE is performed before OUTREC in your example.
This maybe a better approach and no need for Step2
Code: |
SORT FIELDS=COPY
INREC BUILD=(1,70,71:DATENS(YMD)-90)
OUTFIL INCLUDE=(65,6,CH,LE,71,6,CH),BUILD=(1,70)
|
Gerry |
|
Back to top |
|
|
|