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
 

 

Comp-3 to Numeric conversion

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
m.porwal

New User


Joined: 24 Jun 2005
Posts: 1
Location: Pune (India)

PostPosted: Mon Jul 04, 2005 6:45 pm    Post subject: Comp-3 to Numeric conversion
Reply with quote

Hi,
There is a Variable ws-num1 PIC 9(16) comp-3.
I want to copy data starting from 8th position to 3 characters to another variable ws-num2 PIC 9(3).
I want to copy data from one file to another.
Is it possible through JCL.

Thanks
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Jul 04, 2005 6:53 pm    Post subject: Re: Comp-3 to Numeric conversion
Reply with quote

Hi m.porwal,

Check this link......

http://ibmmainframes.com/viewtopic.php?t=3353&highlight=

Regards,

Priyesh.
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: Mon Jul 04, 2005 9:15 pm    Post subject:
Reply with quote

A PIC 9(16) comp-3 value is a 9-byte PD value that might look like this in hex:

X'01234567890123456C'

Let's assume it starts in position 1.

If you mean that you want to convert the digits 890 to C'890' in positions 1-3, you can do it like this:

Code:

* Convert X'abcd' to C'abcd'.
   INREC FIELDS=(5,2,HEX)
* Truncate C'abcd' to C'abc'.
   OUTREC FIELDS=(1,3)


If you want more specific help, you need to explain in more detail exactly what you're trying to do and show what your input records look like and what you want the output records to look like. Also, what's the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
kotesh

New User


Joined: 11 May 2005
Posts: 20

PostPosted: Wed Jul 06, 2005 4:45 pm    Post subject:
Reply with quote

icon_surprised.gif icon_lol.gif icon_cool.gif
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Conversion of a VB file to FB. isssal DFSORT/ICETOOL 1 Mon Oct 31, 2016 10:23 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


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