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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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