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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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