# sorting analysis...pls help:

Author Message
ram_vizag

Active User

Joined: 21 Aug 2008
Posts: 112
Location: hyd

Posted: Tue Oct 29, 2013 6:33 pm

Hi,

 Code: SORT FIELDS=(47,29,CH,A,                            1,42,CH,A)    SUM FIELDS=NONE                      OUTREC FIELDS=(1:1,185,X'00000001',                190:190,260)          END

The input rec is having record length of 449.
Is that outrec does ' to place 4 from 185th field. and from 190 to 260 what will happen????
expat

Global Moderator

Joined: 14 Mar 2007
Posts: 8794
Location: Welsh Wales

 Posted: Tue Oct 29, 2013 6:42 pm What results did you get when you tried it ?
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

Posted: Tue Oct 29, 2013 6:44 pm

 Code: OUTREC FIELDS=(1:1,185,X'00000001',                190:190,260)

There is some silliness here.

Firstly, BUILD should be preferred to FIELDS. FIELDS means different things in different places, BUILD only means one thing, so less confusing.

For BUILD (and FIELDS) the default starting position is byte 1. So no need for "1:". 189 bytes are then placed in the output record area, so no need for "190:" either. By including column numbers where they are not needed, clarity is lost and maintenance made more difficult.

Without the OUTREC, the output record would consist of the data 1 for a length of 439.

What the OUTREC is doing is copying 185 bytes from position 1, 260 bytes from position 190, and blatting four bytes to binary one starting at 186.

It should be noted that OUTREC runs after the SUM, so you may now end up with records which are identical but for which duplicates would have been dropped if INREC was used instead of OUTREC.

The code should be

 Code: OVERLAY=(186:X'00000001')

It should be on INREC if you want the SUM to take account of it, else on OUTREC.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Forum Replies Similar Topics Creating additional seqnum/Literal wh... DFSORT/ICETOOL 4 Sorry - Trying again: How can we impr... ABENDS & Debugging 2 I need help with analysis of a COBOL ... All Other Mainframe Topics 14 ICETOOL Sorting and Discarding DUPS SYNCSORT 11 Code Coverage and static analysis too... PL/I & Assembler 2