Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Why INREC and OUTREC in SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Hemant B.

New User


Joined: 05 Oct 2006
Posts: 8

PostPosted: Thu Oct 12, 2006 9:52 am    Post subject: Why INREC and OUTREC in SORT
Reply with quote

Why we use INREC and OUTREC in JCL SORT?

and
what it means....
Code:
sortrec fields= (1:25,10)
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Oct 12, 2006 10:13 am    Post subject:
Reply with quote

Hi There.

You can change the layout of a record both before and after it is sorted using the INREC and OUTREC keywords. You simply specify the fields to be included in the new record.
INREC reformats the record layout before it is passed through the sort, while OUTREC will reformat the record layout after the record has been sorted.


Here's some examples:
SORT FIELDS=(1,10,CH,A)
INREC=(1,10,CH,50,4,PD,40,4,PD)


SORT FIELDS=(1,10,CH,A)
OUTREC=(1,10,50,4,40,4)

Both examples will reformat the record so that it consists of the first 10 bytes of the input record, followed by the 4 bytes starting at position 50, followed by the 4 bytes starting at position 40.
Back to top
View user's profile Send private message
Hemant B.

New User


Joined: 05 Oct 2006
Posts: 8

PostPosted: Thu Oct 12, 2006 10:33 am    Post subject:
Reply with quote

means there is no difference between inrec and outrec.
inrec for before pass it to sort and outrec for after sort..

and whats the
outrec fields=(1:25,10) means?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Oct 12, 2006 9:02 pm    Post subject:
Reply with quote

Code:

   OUTREC FIELDS=(1:25,10)


This OUTREC statement writes output records with input positions 25-34 in output positions 1-10.

Quote:
means there is no difference betn inrec and out rec.
inrec for before pass it to sort and outrec for after sort..


INREC and OUTREC can both reformat records in the same way and are often interchangeable. However, if you need SORT to see the reformatted records, you would use INREC. For example:

Code:

   INREC OVERLAY=(81:SEQNUM,8,ZD)
   SORT FIELDS=(81,8,ZD,A)


Here we're adding a sequence number to each record so we can sort on it. INREC works for this because it add the sequence numbers before the records are sorted. OUTREC would not work for this because it would add the sequence numbers after the records are sorted.

Quote:
Here's some examples:
SORT FIELDS=(1,10,CH,A)
INREC=(1,10,CH,50,4,PD,40,4,PD)


SORT FIELDS=(1,10,CH,A)
OUTREC=(1,10,50,4,40,4)

Both examples will reformat the record so that it consists of the first 10 bytes of the input record, followed by the 4 bytes starting at position 50, followed by the 4 bytes starting at position 40.


Lots of errors here. INREC= and OUTREC= are invalid. It should be:

Code:

   INREC FIELDS=(...) 

and

   OUTREC FIELDS=(...)


The CH in the first INREC statement is invalid. It should be 1,10,50,... rather than 1,10,CH,50,... CH is not allowed (or needed).

The explanation for what the OUTREC statement does is correct. But the INREC statement works differently because of the PD fields. 50,4,PD indicates input positions 50-53 has a PD field to be converted using the M0 edit mask. Likewise, 40,4,PD indicates input positions 40-43 has a PD field to be converted using the M0 edit mask. The results of the INREC statement and the OUTREC statement would be very different.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us