View previous topic :: View next topic
|
Author |
Message |
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
I have one more query.
I have my input file as
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
12122
000000000000FFFFF4444444444444444444444444444444444444444444444444444444
000000000000121230000000000000000000000000000000000000000000000000000000
â qo" q ¤
FFFF00430997009394444444444444444444444444444444444444444444444444444444
FFFF0F2F086F0088F0000000000000000000000000000000000000000000000000000000
12123
000000000000FFFFF4444444444444444444444444444444444444444444444444444444
000000000000121230000000000000000000000000000000000000000000000000000000
-----------------------------------------------------------------------
PAYM O¶ ¾ `T715014 ð 1715014 S1894628
DCED00DB0001B002007EFFFFFF01014400080000000044444444FFFFFFF00101EFFFFFFF
71840166000F9C2202937150140A0A0000AC0000000000000000171501400A0A21894628
-----------------------------------------------------------------------
â qo" q ¤
FFFF00430997009394444444444444444444444444444444444444444444444444444444
FFFF0F2F086F0088F0000000000000000000000000000000000000000000000000000000
12125
000000000000FFFFF4444444444444444444444444444444444444444444444444444444
000000000000121230000000000000000000000000000000000000000000000000000000
â qo" q ¤
FFFF00430997009394444444444444444444444444444444444444444444444444444444
FFFF0F2F086F0088F0000000000000000000000000000000000000000000000000000000
|
And I need to my output file as below.
Code: |
12123
000000000000FFFFF4444444444444444444444444444444444444444444444444444444
000000000000121230000000000000000000000000000000000000000000000000000000
-----------------------------------------------------------------------
PAYM O¶ ¾ `T715014 ð 1715014 S1894628
DCED00DB0001B002007EFFFFFF01014400080000000044444444FFFFFFF00101EFFFFFFF
71840166000F9C2202937150140A0A0000AC0000000000000000171501400A0A21894628
-----------------------------------------------------------------------
â qo" q ¤
FFFF00430997009394444444444444444444444444444444444444444444444444444444
FFFF0F2F086F0088F0000000000000000000000000000000000000000000000000000000
|
Logic behind this output file is I want the record which is above the PAYM recd and below the PAYM record.
In Input file it can have more than one PAYM record like
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
12122
000000000000FFFFF4444444444444444444444444444444444444444444444444444444
000000000000121230000000000000000000000000000000000000000000000000000000
â qo" q ¤
FFFF00430997009394444444444444444444444444444444444444444444444444444444
FFFF0F2F086F0088F0000000000000000000000000000000000000000000000000000000
12123
000000000000FFFFF4444444444444444444444444444444444444444444444444444444
000000000000121230000000000000000000000000000000000000000000000000000000
-----------------------------------------------------------------------
PAYM O¶ ¾ `T715014 ð 1715014 S1894628
DCED00DB0001B002007EFFFFFF01014400080000000044444444FFFFFFF00101EFFFFFFF
71840166000F9C2202937150140A0A0000AC0000000000000000171501400A0A21894628
PAYM2 O¶ ¾ `T715014 ð 1715014 S1894628
DCED00DB0001B002007EFFFFFF01014400080000000044444444FFFFFFF00101EFFFFFFF
71840166000F9C2202937150140A0A0000AC0000000000000000171501400A0A21894628
-----------------------------------------------------------------------
â qo" q ¤
FFFF00430997009394444444444444444444444444444444444444444444444444444444
FFFF0F2F086F0088F0000000000000000000000000000000000000000000000000000000
12125
000000000000FFFFF4444444444444444444444444444444444444444444444444444444
000000000000121230000000000000000000000000000000000000000000000000000000
â qo" q ¤
FFFF00430997009394444444444444444444444444444444444444444444444444444444
FFFF0F2F086F0088F0000000000000000000000000000000000000000000000000000000
|
Any suggestions whether this can be implemented in sort ..
thanks in advance |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
In Input file it can have more than one PAYM record like |
And what do you want for output in that case?
You need to explain more clearly what you want to do before we can help.
Please explain the "rules" you want to use for all possible situations (one PAYM record, two PAYM records, etc). Also, give the RECFM and LRECL of the input file and any other relevant information. |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
In output file I want the record which is just above the first PAYM record , all PAYM records and Record which is just after last PAYM records.
RECFM=FB. LRECL=32500 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Clear as mud.
It's not clear if the PAYM records are always sequential (e.g. data records, 5 PAYM records, data records) or can be spread throughout the file (e.g. data records, PAYM record, data records, PAYM record, etc)?
Since you are having trouble describing what you want, you'll need to show examples (for any and all possible cases). |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
With this data:
Data1
Data2
Data3
PAYM
Data4
PAYM
PAYM
Data5
PAYM
Data6
Data7
Data8
i believe the desired output is:
Data3
PAYM
Data4
PAYM
PAYM
Data5
PAYM
Data6 |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Input file will be a little different it can be like this.
Data1
Data2
Data3
PAYM
Data4
Data5
Data6
Data1
PAYM
PAYM
Data2
Data3
Data4
Data5
Data6
Its like payment record will be together only and in a single bunch |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
In your example, what should be the output?
The Data(n's) appear to repeat. . .
Your rule says:
Quote: |
I want the record which is just above the first PAYM record , all PAYM records and Record which is just after last PAYM records |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
It looks like Batch Header (binary zeros), data, Batch Trailer (hex FFs).
Is there other data in some batches. so what you want is all the batches with PAYMs and which can only contain PAYMs, not be mixed with other data? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
scorp_rahul23 wrote: |
Input file will be a little different it can be like this.
Data1
Data2
Data3
PAYM
Data4
Data5
Data6
Data1
PAYM
PAYM
Data2
Data3
Data4
Data5
Data6
Its like payment record will be together only and in a single bunch |
and the expected output from this is ?????? |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Quote: |
Data1
Data2
Data3
PAYM
Data4
Data5
Data6
Data1
PAYM
PAYM
Data2
Data3
Data4
Data5
Data6
Its like payment record will be together only and in a single bunch
|
Output will be
Data3
PAYM
Data4
Data1
PAYM
PAYM
Data2 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You still have not provided what is needed. . .
How does one know when one "group" ends and the next begins. . .
You need to post (in English sentences) the rules for the process to follow. . . |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I believe those are two separate sets of input records - right? It appears that the PAYM records will only appear at one point in the input file, but there could be more than one PAYM record at that point and they will be consecutive. So for the one, two, three, etc PAYM records, you want the record before the first PAYM record and the record after the last PAYM record.
Is that correct? |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Yes Frank you are right |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
scorp_rahul23 wrote: |
Yes Frank you are right |
How do you explain
Code: |
Data1
Data2
Data3
PAYM
Data4
Data5
Data6
Data1
PAYM
PAYM
Data2
Data3
Data4
Data5
Data6
|
Output will be
Code: |
Data3
PAYM
Data4 <<< how did this get in the output which is after PAYM?
Data1
PAYM
PAYM
Data2
|
Assuming that data4 record is a typo , the following DFSORT/ICETOOL JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
Data1
Data2
Data3
PAYM
Data4
Data5
Data6
Data1
PAYM
PAYM
Data2
Data3
Data4
Data5
Data6
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(32501,8,CH) ALLDUPS USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(32501:SEQNUM,8,ZD,X,
SEQNUM,8,ZD,RESTART=(1,4))),
IFTHEN=(WHEN=(1,4,CH,EQ,C'PAYM',AND,32510,8,ZD,EQ,1),
OVERLAY=(32501:+1,SUB,32501,8,ZD,M11,LENGTH=8)),
IFTHEN=(WHEN=(1,4,CH,EQ,C'PAYM',AND,32510,8,ZD,EQ,2),
OVERLAY=(32501:+1,ADD,32501,8,ZD,M11,LENGTH=8))
OUTFIL BUILD=(1,32500)
//* |
The output from the above is
Code: |
Data3
PAYM
Data1
PAYM
PAYM
Data2 |
|
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Thanks a lot it worked . U are too good |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
If my data is like
Data1
Data2
Data3
PAYM
Data4
Data5
Data6
I need output like
Data3
PAYM
Data4
But the code is not giving me desired output. Any sugeestions why its not working |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Suggest you post the sort cards, sysout and what is being produced. |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
Data1
Data2
Data3
PAYM
Data4
Data5
Data6
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(32501,8,CH) ALLDUPS USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(32501:SEQNUM,8,ZD,X,
SEQNUM,8,ZD,RESTART=(1,4))),
IFTHEN=(WHEN=(1,4,CH,EQ,C'PAYM',AND,32510,8,ZD,EQ,1),
OVERLAY=(32501:+1,SUB,32501,8,ZD,M11,LENGTH=8)),
IFTHEN=(WHEN=(1,4,CH,EQ,C'PAYM',AND,32510,8,ZD,EQ,2),
OVERLAY=(32501:+1,ADD,32501,8,ZD,M11,LENGTH=8))
OUTFIL BUILD=(1,32500)
//*
|
Output was
Data3
PAYM |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You missed commenting on what Kolusu said here.
Skolusu wrote: |
scorp_rahul23 wrote: |
Yes Frank you are right |
How do you explain
Code: |
Data1
Data2
Data3
PAYM
Data4
Data5
Data6
Data1
PAYM
PAYM
Data2
Data3
Data4
Data5
Data6
|
Output will be
Code: |
Data3
PAYM
Data4 <<< how did this get in the output which is after PAYM?
Data1
PAYM
PAYM
Data2
|
Assuming that data4 record is a typo , the following DFSORT/ICETOOL JCL will give you the desired results.
[...] |
|
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
I missed that out, but as per the my output file requirement its not a typo. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Kolusu showed you the output from the given input, and it has your exact example.
You are saying, when there is one PAYM you want the record in front, the PAYM, and the record after. When there are two PAYM you want the record in front of the first, the two PAYM and the one after the second?
Can there be more than two PAYM, so we again try to get the whole thing at once? |
|
Back to top |
|
|
scorp_rahul23
New User
Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
I want to have all records with PAYM whether they are 2 or 3. They will always be continuos.
And apart from that I need a records which is just before first PAYM record and just after last paym record. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Frank Yaeger wrote: |
So for the one, two, three, etc PAYM records, you want the record before the first PAYM record and the record after the last PAYM record. |
scorp_rahul23 wrote: |
I want to have all records with PAYM whether they are 2 or 3. They will always be continuos.
And apart from that I need a records which is just before first PAYM record and just after last paym record. |
I was just going through some of the older topics here, the TS said that he needs the record following the last 'PAYM' record also, pretty much same as what Frank had asked earlier. Do we have a solution yet for this?
Sorry for bringing up an year-old topic. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
This one suits the subject, I haven't gone through the topic :-)
The 83,1,ZD,EQ,1 (which is looking at the match marker) identifies the last record. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Bill,
I just went through the topic you gave, i doubt if the same can be applied here in this case, anyways that was a good one though!. Thanks Bill
btw for this one, I just worked out one method, but can't post it here due to compatibility issues. The topic is old, but I got surprised by the number of views! |
|
Back to top |
|
|
|