View previous topic :: View next topic
|
Author |
Message |
chandrupegasus Warnings : 1 New User
Joined: 16 Jan 2007 Posts: 11 Location: Bangalore
|
|
|
|
Hi, I have one query on SORT. Pls help me out on this.
My INPUT file has a numeric field length of 6 bytes.
Using this file I need to run SORT utility and the numeric field has to be converted to comp-3 (packed decimal) in the output. How the sort looks like and what would be the OUTREC FIELD?. Pls explain me. Thanks. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
With the information in hand -- one can suggest you this:
Code: |
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(position,6,BI,TO=PD,LENGTH=??)
/* |
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
chandrupegasus wrote: |
My INPUT file has a numeric field length of 6 bytes. |
Define "numeric".... |
|
Back to top |
|
|
chandrupegasus Warnings : 1 New User
Joined: 16 Jan 2007 Posts: 11 Location: Bangalore
|
|
|
|
Thanks anuj, The outrec is working fine. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
You're welcome, however, I gave you solution with INREC . . . though for your question any from INREC/OUTREC can be used. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Quote: |
though for your question any from INREC/OUTREC can be used. |
But it is always better to use OUTREC after COPY, MERGE or SORT operations. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
But it is always better to use OUTREC after COPY, MERGE or SORT operations. |
Why do you say that? It's not true.
For COPY, it doesn't matter if you use INREC or OUTREC.
For SORT or MERGE, you would use INREC if you want to reformat the records before sorting or merging, or OUTREC if you want to reformat the records after sorting or merging.
If it doesn't matter whether you reformat the records before or after sorting, and your reformatting decreases the size of the records, it may be more efficient to use INREC instead of OUTREC.
If it doesn't matter whether you reformat the records before or after sorting, and your reformatting increases the size of the records, it may be more efficient to use OUTREC instead of INREC. |
|
Back to top |
|
|
|