For Programmers: Free Programming Magazines  


Home > Archive > Cobol > March 2007 > data type conversion- help needed









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author data type conversion- help needed
harsha

2007-03-22, 9:55 pm

Hi All,


I need to convert the following COMP/BINARY field

05 COUNTER PIC S9(9) COMP

into the regular usage as below

05 WS-COUNTER PIC 9(9).

Im refering to mainframe cobol(85).

Could any of you please let me know how to do this...
Im struck at this point............

Thanks in advance

- Harsha

LX-i

2007-03-22, 9:55 pm

harsha wrote:
> Hi All,
>
>
> I need to convert the following COMP/BINARY field
>
> 05 COUNTER PIC S9(9) COMP
>
> into the regular usage as below
>
> 05 WS-COUNTER PIC 9(9).
>
> Im refering to mainframe cobol(85).
>
> Could any of you please let me know how to do this...
> Im struck at this point............


I'd try

MOVE COUNTER TO WS-COUNTER

and see what that gets you...


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Albuquerque, NM! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~

"Who is more irrational? A man who believes in a God he doesn't see, or
a man who's offended by a God he doesn't believe in?" - Brad Stine
HeyBub

2007-03-22, 9:55 pm

harsha wrote:
> Hi All,
>
>
> I need to convert the following COMP/BINARY field
>
> 05 COUNTER PIC S9(9) COMP
>
> into the regular usage as below
>
> 05 WS-COUNTER PIC 9(9).
>
> Im refering to mainframe cobol(85).
>
> Could any of you please let me know how to do this...
> Im struck at this point............


Does your compiler have the full complement of logrithmic functions?
> Thanks in advance
>
> - Harsha



2007-03-23, 7:55 am

In article <1174610550.807381.247400@o5g2000hsb.googlegroups.com>,
harsha <harshaa@gmail.com> wrote:
>Hi All,
>
>
>I need to convert the following COMP/BINARY field


Please do your own homework.

DD
jnjsle1@optonline.net

2007-03-26, 9:55 pm

On Mar 23, 5:15 am, docdw...@panix.com () wrote:
> In article <1174610550.807381.247...@o5g2000hsb.googlegroups.com>,
>
> harsha <hars...@gmail.com> wrote:
>
>
> Please do your own homework.
>
> DD


LX-i's solution is good but you may have to change your PIC to S9(10)
to accommodate the sign and the max value of the comp field.

PS - DD's suggestion is a good one too.

2007-03-26, 9:55 pm

In article <1174958010.425403.317590@r56g2000hsd.googlegroups.com>,
<jnjsle1@optonline.net> wrote:
>On Mar 23, 5:15 am, docdw...@panix.com () wrote:

[snip]
[color=darkred]
>PS - DD's suggestion is a good one too.


Oh, I *cannot* resist... some might say my suggestion is both hackneyed or
boring from much use, yet still contains a bit of verity...

.... others might say it is the old Trite and True.

DD
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com