Sort only detail records



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Re: Sort only detail records

Postby ajuatsgp » Fri Sep 09, 2011 12:46 pm

I have already added 400 and taken care of the offset position for the Record Key.
My sort card is as follows:
INREC IFTHEN=(WHEN=(6,2,ZD,EQ,01,OR,6,2,ZD,EQ,02,OR,6,2,ZD,EQ,03,OR,
6,2,ZD,EQ,04,OR,6,2,ZD,EQ,99),OVERLAY=(453:1,2)),
IFTHEN=(WHEN=GROUP,BEGIN=(6,2,ZD,EQ,01),PUSH=(445:ID=8)),
IFTHEN=(WHEN=(6,2,ZD,EQ,03),OVERLAY=(455:23,6))
SORT FIELDS=(445,16,CH,A),EQUALS
OUTREC BUILD=(1,44)

But I am getting below errors:
INREC IFTHEN=(WHEN=(6,2,ZD,EQ,01,OR,6,2,ZD,EQ,02,OR,6,2,ZD,EQ,03,OR,
6,2,ZD,EQ,04,OR,6,2,ZD,EQ,99),OVERLAY=(453:1,2)),
IFTHEN=(WHEN=GROUP,BEGIN=(6,2,ZD,EQ,01),PUSH=(445:ID=8)),
$
ICE107A F DUPLICATE, CONFLICTING, OR MISSING INREC OR OUTREC STATEMENT OPERANDS
IFTHEN=(WHEN=(6,2,ZD,EQ,03),OVERLAY=(455:23,6))
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
SORT FIELDS=(445,16,CH,A),EQUALS
OUTREC BUILD=(1,44)
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort only detail records

Postby enrico-sorichetti » Fri Sep 09, 2011 1:05 pm

instead of the confusing color use the code tags, it makes code much easier to read
and You do not lose <important> spacing

You completely changed the overlay logic ..
and You are using a mix of 1 and 6 columns/position
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Sort only detail records

Postby ajuatsgp » Fri Sep 09, 2011 1:21 pm

My Code:
INREC IFTHEN=(WHEN=(6,2,ZD,EQ,01,OR,6,2,ZD,EQ,02,OR,6,2,ZD,EQ,03,OR,
                    6,2,ZD,EQ,04,OR,6,2,ZD,EQ,99),OVERLAY=(453:1,2)),
      IFTHEN=(WHEN=GROUP,BEGIN=(6,2,ZD,EQ,01),PUSH=(445:ID=8)),
      IFTHEN=(WHEN=(6,2,ZD,EQ,03),OVERLAY=(455:23,6))
SORT FIELDS=(445,16,CH,A),EQUALS
OUTREC BUILD=(1,44)


Error Message:
           INREC IFTHEN=(WHEN=(6,2,ZD,EQ,01,OR,6,2,ZD,EQ,02,OR,6,2,ZD,EQ,03,OR,
                               6,2,ZD,EQ,04,OR,6,2,ZD,EQ,99),OVERLAY=(453:1,2)),
                 IFTHEN=(WHEN=GROUP,BEGIN=(6,2,ZD,EQ,01),PUSH=(445:ID=8)),
                              $
ICE107A F DUPLICATE, CONFLICTING, OR MISSING INREC OR OUTREC STATEMENT OPERANDS
                 IFTHEN=(WHEN=(6,2,ZD,EQ,03),OVERLAY=(455:23,6))
                 $
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
           SORT FIELDS=(445,16,CH,A),EQUALS
           OUTREC BUILD=(1,44)
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort only detail records

Postby ajuatsgp » Fri Sep 09, 2011 5:24 pm

Hi,
The latest update is I am using below code:
INREC IFTHEN=(WHEN=GROUP,BEGIN=(6,2,ZD,EQ,02),PUSH=(445:ID=8)),
      IFTHEN=(WHEN=(6,2,ZD,EQ,01,OR,6,2,ZD,EQ,02,OR,6,2,ZD,EQ,03,OR,
                    6,2,ZD,EQ,04,OR,6,2,ZD,EQ,99),OVERLAY=(453:6,2)),
      IFTHEN=(WHEN=(6,2,ZD,EQ,03),OVERLAY=(455:23,6))
SORT FIELDS=(445,16,CH,A),EQUALS

And below is how my output file looks in 445-460 byte
4----+----5----+----6
*********************
             00
     0000000101
     0000000103
     0000000103
     0000000103
     0000000103
     0000000103
     0000000103
     0000000103
     0000000103
     0000000103
     0000000104
     0000000201
     0000000203
     0000000203
     0000000203
     0000000203

I can't find the 6 byte field of record type=03 which starts at position 26 and hence the final output is not what I am expecting
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort only detail records

Postby ajuatsgp » Fri Sep 09, 2011 7:06 pm

Finally with so many try I got my desired output the code I used is:
INREC IFTHEN=(WHEN=GROUP,BEGIN=(6,2,ZD,EQ,02),PUSH=(445:ID=8)),
      IFTHEN=(WHEN=(6,2,ZD,EQ,03),OVERLAY=(453:6,2,455:23,6)),
      IFTHEN=(WHEN=(6,2,ZD,EQ,01,OR,6,2,ZD,EQ,02,OR,
                    6,2,ZD,EQ,04,OR,6,2,ZD,EQ,99),OVERLAY=(453:6,2))
SORT FIELDS=(445,16,CH,A),EQUALS
OUTREC BUILD=(1,444)
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort only detail records

Postby skolusu » Fri Sep 09, 2011 7:14 pm

ajuatsgp,

I kind of give up. Despite my efforts of spoon feeding you go ahead and code your own control cards. Why did you have to change the WHEN=INIT statement to your own logic? Even with your latest cards I doubt if you got the desired output (since the detail records does not have their record indicator in pos 453). please do NOT waste my time when you can't even follow simple directions.

Thanks

Kolusu
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Sort only detail records

Postby ajuatsgp » Fri Sep 09, 2011 8:53 pm

Dear Kolusu,
Sorry but I had to change the control card because:
1. I have already mentioned in a post after your solution that my Record type does not start at the beginning of the file, it starts @ position 6.Hence I had to change WHEN=INIT
2.If you look into the 2nd IFTHEN there I have taken care of position 453, I had to do that because when I was giving it in two different IFTHEN for same record type it was not working properly.
Please read my previous posts,there I have mentioned the issue I was getting for which I had to modify your control card a little.
I would really like to thank you.Without your input I could have never done that in a control card.
Please go throuh all intermediate posts and let me know if I have done any mistake
ajuatsgp
 
Posts: 82
Joined: Thu May 20, 2010 6:50 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post