Page 2 of 2

Re: Sort only detail records

PostPosted: Fri Sep 09, 2011 12:46 pm
by ajuatsgp
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)

Re: Sort only detail records

PostPosted: Fri Sep 09, 2011 1:05 pm
by enrico-sorichetti
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

Re: Sort only detail records

PostPosted: Fri Sep 09, 2011 1:21 pm
by ajuatsgp
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)

Re: Sort only detail records

PostPosted: Fri Sep 09, 2011 5:24 pm
by ajuatsgp
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

Re: Sort only detail records

PostPosted: Fri Sep 09, 2011 7:06 pm
by ajuatsgp
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)

Re: Sort only detail records

PostPosted: Fri Sep 09, 2011 7:14 pm
by skolusu
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

Re: Sort only detail records

PostPosted: Fri Sep 09, 2011 8:53 pm
by ajuatsgp
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