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 to comp-3 Conversion

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

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Thu Sep 13, 2007 1:56 pm    Post subject: Comp to comp-3 Conversion
Reply with quote

Hi,

Pls tell me how to convert

s9(9) comp to 9(7)V99 format.

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

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Sep 13, 2007 2:22 pm    Post subject: Re: comp to comp-3 Conversion
Reply with quote

Anand78 wrote:
Pls tell me how to convert
s9(9) comp to 9(7)V99 format.
Comp to COMP-3 or Display?
With a decimal point shift? The 'V' is implied, it's not really there....
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Thu Sep 13, 2007 2:56 pm    Post subject:
Reply with quote

redefine s9(09) with s9(07)v99
MOVE S9(9) comp variable to a s9(09).

maybe I haven't got your requirement correctly, let us know if anything else is needed.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Sep 13, 2007 3:03 pm    Post subject:
Reply with quote

Abhijit, I kind of made the assumption that the OP was looking for a sort solution since that is the forum he posted his question in.....
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 Sep 13, 2007 8:44 pm    Post subject:
Reply with quote

Anand,

If you look at:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/C.3?DT=20060615185603

you'll see that s9(9) comp is a 4-byte FI value and 9(7)V99 comp-3 is a 5-byte PD value.

You could use DFSORT control statements like the following to do the conversion:

Code:

   OPTION COPY
   INREC BUILD=(...,p,4,FI,TO=PD,LENGTH=5,...)


For more information on this type of conversion, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.7?DT=20060615173822
Back to top
View user's profile Send private message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Mon Sep 17, 2007 12:18 pm    Post subject:
Reply with quote

Hi Abhijit,

I want to achieve the conversion thru jcl, I got it thru below format.

input field is S9(9) comp.
output field is 9(7)V99.

outrec fields=(1:1,4,bi,zd,length=7,
8:2x'F0')

Thanks your time and response to this question.

Anand.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Mon Sep 17, 2007 12:24 pm    Post subject:
Reply with quote

I posted COBOL solution because you mentioned COBOL variable declarations in your question.
Happy to know that you got the solution. And thanks for letting us know about that. icon_smile.gif
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 Sep 17, 2007 8:55 pm    Post subject:
Reply with quote

Anand,

Your Subject line says COMP to COMP-3, but you apparently don't really want a COMP-3 output field since you're using ZD rather than PD. In the future, please try to have your Subject line match what you really want so as not to confuse people.

And I don't know why you're inserting '00' for the two decimal places but hopefully you know what you're doing.
Back to top
View user's profile Send private message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Thu Sep 20, 2007 6:23 pm    Post subject: comp to comp-3 Conversion (Doubt)
Reply with quote

Hi Frank,

The following control statements u asked to use to convert comp to
comp-3 conversion, I had one doubt in that.

Assume the following data.
Eg: 01 ws-qty pic s9(9) comp, holds value 123456789

When u execute the below control stmnts,
OPTION COPY
INREC BUILD=(...,p,4,FI,TO=PD,LENGTH=5,...)

the output for the variable ws-qty-out pic s9(7)v99 comp-3 will be
1234567.89, but decimal portion should be zero.

Thanks
Anand[/b]
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 Sep 20, 2007 9:25 pm    Post subject:
Reply with quote

A PD value does NOT have a decimal portion. The value would be P'123456789'. You can convert it to displayable format of '1234567.89'. It's not clear if you want the output to be a PD value with P'123456700' or a displayable value with '1234567.00' or what. Please clarify what you want.
Back to top
View user's profile Send private message
Anand78

New User


Joined: 06 Mar 2006
Posts: 50
Location: PUNE

PostPosted: Fri Sep 21, 2007 11:43 am    Post subject: comp to comp-3 Conversion
Reply with quote

Frank,

I have a variable with pic clause s9(9) comp , it will hold value of
123456789, when it is converted to variale s9(7)v99 comp-3.

o/p variable should hold value P'3456789.00', values should be
moved from right to left also decimal portion should be zero.

Thanks,
Anand
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: Fri Sep 21, 2007 8:57 pm    Post subject:
Reply with quote

As I said, a PD value does not store the decimal point. It appears that you want to convert 123456789 = X'075BCD15' to P'345678900' = X'345678900C'. A DFSORT INREC statement like this will do it:

Code:

  INREC BUILD=(...,p,4,FI,MUL,+100,TO=PD,LENGTH=5,..)
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 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 Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts EBCDIC to ASCII conversion using OCOPY mistah kurtz All Other Mainframe Topics 5 Tue Sep 06, 2016 2:26 pm

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