IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

sorting analysis...pls help:


 
IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: :: View next topic  
Author Message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Oct 29, 2013 6:33 pm
Reply with quote

Hi,

Please explain about what outrec is doing in below code:

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????
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Oct 29, 2013 6:42 pm
Reply with quote

What results did you get when you tried it ?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


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

PostPosted: Tue Oct 29, 2013 6:44 pm
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> JCL & VSAM
Page 1 of 1

 

Search our Forum:

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

Back to Top