IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Whether records get sorted when we use outrec or not


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VENKATA999
Warnings : 2

New User


Joined: 05 Jan 2006
Posts: 44

PostPosted: Wed Sep 06, 2006 2:39 pm
Reply with quote

Hi ,

In one book , i read some thing like "INREC adds, deletes, or reformats fields before the records are sorted or merged

OUTREC adds, deletes, or reformats fields after the records are sorted or merged"

but when i am doing practice , i found that output records are not getting sorted in both the cases . I mean inrec as well as outrec .

if anyone help me whether records get sorted when we use outrec or not or is programmer responsibility to sort before use outrec .

Thanks&Regards

venkata .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Sep 06, 2006 9:03 pm
Reply with quote

I'm not sure what you're asking. If you use a SORT statement, then the records are sorted regardless of whether or not you use INREC or OUTREC.

If you have:

Code:

   INREC FIELDS=(...)
   SORT FIELDS=(...)
   OUTREC FIELDS=(...)


1) the records are reformatted according to what you specify for the INREC fields.
2) the reformatted records are sorted according to what you specify for the SORT fields.
3) the sorted records are reformatted according to what you specify for the OUTREC fields.

If you specify a MERGE statement instead of a SORT statement, the records will be merged instead of sorted.

If you specify COPY instead of SORT, the records will be copied instead of sorted.

If that doesn't answer your question, then you'll need to explain more clearly what it is you're asking about.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
VENKATA999
Warnings : 2

New User


Joined: 05 Jan 2006
Posts: 44

PostPosted: Wed Sep 06, 2006 9:26 pm
Reply with quote

Thanks a lot for answering my question. Can u please tell me when we should use inrec or outrec . How performance get improved if i go for inrec . In my example i am getting same output for both inrec & outrec .In the result the records are not in order in the both the options .

Please help me ........ ..

Thank you,
venkata.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Sep 06, 2006 11:07 pm
Reply with quote

Quote:
Can u please tell me when we should use inrec or outrec.


If you need to reformat the records before sorting them, then use INREC. Keep in mind that SORT, SUM, OUTREC, etc operate on the records as changed by INREC. So when you specify INREC, you must set up your SORT fields to correspond to the reformatted INREC record.

If you need to reformat the records after sorting them, use OUTREC.

Quote:
How performance get improved if i go for inrec.


If you can significantly shorten the input records before sorting by using INREC, then you may see some performance gain. But, in general, you shouldn't use INREC just to try to improve performance.

Quote:
In my example i am getting same output for both inrec & outrec. In the result the records are not in order in the both the options.


What example? You haven't shown any control statements, any input records or any output records, so I don't know what you're doing or what result you're getting. I can't explain things based on reading your mind. You need to show me what you're talking about.

Quote:
Please help me


I'd be glad to, but you need to give me enough information so I can do that.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top