Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 3270 Data stream error Benchwarmer CICS 4 Tue Apr 17, 2018 12:06 am
No new posts How to list data set names with diffe... murali.andaluri CLIST & REXX 8 Thu Apr 12, 2018 11:33 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Invalid XML character while producing... nikhil.bhole IBM Tools 4 Tue Mar 20, 2018 1:24 am
No new posts Get the list of data sets on DASD and... rakaitn JCL & VSAM 3 Thu Mar 08, 2018 12:38 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us