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
 

 

converting a numreic data into comp-3 value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
chandrupegasus
Warnings : 1

New User


Joined: 16 Jan 2007
Posts: 11
Location: Bangalore

PostPosted: Mon May 11, 2009 3:08 pm    Post subject: converting a numreic data into comp-3 value
Reply with quote

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
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon May 11, 2009 4:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon May 11, 2009 5:35 pm    Post subject: Re: converting a numreic data into comp-3 value
Reply with quote

chandrupegasus wrote:
My INPUT file has a numeric field length of 6 bytes.
Define "numeric"....
Back to top
View user's profile Send private message
chandrupegasus
Warnings : 1

New User


Joined: 16 Jan 2007
Posts: 11
Location: Bangalore

PostPosted: Wed May 13, 2009 5:27 pm    Post subject: Reply to: converting a numreic data into comp-3 value
Reply with quote

Thanks anuj, The outrec is working fine.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu May 14, 2009 2:57 pm    Post subject:
Reply with quote

You're welcome, however, I gave you solution with INREC . . . icon_smile.gif though for your question any from INREC/OUTREC can be used.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu May 14, 2009 3:22 pm    Post subject: Reply to: converting a numreic data into comp-3 value
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Thu May 14, 2009 9:14 pm    Post subject:
Reply with quote

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

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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