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
 
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 File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm

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