What is the difference between Inrec fields and outrec?

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.
Post Reply
alpna
Registered Member
Posts: 56
Joined: Fri Jun 21, 2013 10:35 pm

What is the difference between Inrec fields and outrec?

Post by alpna »

Hi,

What is the difference between Inrec fields and outrec fields? I know that INREC is processed before the SORT is done and OUTREC is after SORTing? But is there any reference using which we can understand which verb will be accessed first among many verbs of DFsort.

Hope my question is clear...
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: What is the difference between Inrec fields and outrec?

Post by William Collins »

See if this link helps. If not, I think you need to make your question clearer.
alpna
Registered Member
Posts: 56
Joined: Fri Jun 21, 2013 10:35 pm

Re: What is the difference between Inrec fields and outrec?

Post by alpna »

Thanks William. Link is very helpful.
MartinPacker
Registered Member
Posts: 14
Joined: Tue May 27, 2014 8:45 pm
Contact:

Re: What is the difference between Inrec fields and outrec?

Post by MartinPacker »

INREC reformats records on the way into a sort. OUTREC (and OUTFIL OUTREC) reformats them on the way out.

General guidance:

1) If you're going to cut down the record length do it on the INREC - if at all possible.

2) You can use INREC with e.g PARSE and IFTHEN to reformat records so that sort fields are in fixed positions. This might be handy for certain types of data - such as CSV.
Martin Packer
Principal Systems Investigator, IBM
alpna
Registered Member
Posts: 56
Joined: Fri Jun 21, 2013 10:35 pm

Re: What is the difference between Inrec fields and outrec?

Post by alpna »

MartinPacker wrote:INREC reformats records on the way into a sort. OUTREC (and OUTFIL OUTREC) reformats them on the way out.
All these "reformats" are done temporarily right and is this the reason we include the WORK-FILES in SORT?
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: What is the difference between Inrec fields and outrec?

Post by enrico-sorichetti »

All these "reformats" are done temporarily right and is this the reason we include the WORK-FILES in SORT?
NOPE, the work file are needed due to the architecture of the sort algorithm
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: What is the difference between Inrec fields and outrec?

Post by William Collins »

Reformatting is only temporary if you make it so, by unwinding it later in the code. You make temporary changes because you need some intermediate value for your task.

If all changes were temporary, there would be no point in running the step.

If there is a SORT and changes have been made in INREC, then the data will be on the sort-work files (if sort-work is needed for the sort), but that is because it is how the sorting of data works, not anything to do with any changes made (or not).
alpna
Registered Member
Posts: 56
Joined: Fri Jun 21, 2013 10:35 pm

Re: What is the difference between Inrec fields and outrec?

Post by alpna »

Thanks!

But many a times I don't supply the SORTWK files in the job but that still works, if they are needed why don't we get en error/
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: What is the difference between Inrec fields and outrec?

Post by William Collins »

Either the amount of data is too small to require work-files or, more likely, you are using DFSORT's dynamic allocation of work datasets which, generally, is the best way to do it. Dynamic allocation is overridden if SORTWKn files are present in the step, which you may want for large datasets with many records of similar size and a few of a greatly different size.
alpna
Registered Member
Posts: 56
Joined: Fri Jun 21, 2013 10:35 pm

Re: What is the difference between Inrec fields and outrec?

Post by alpna »

Ok, thanks William.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DFSort, ICETOOL, ICEMAN, ICEGENER.”