COMP-X ? 
Author Message
 COMP-X ?

What is COMP-X?

I'm converting a program that was written for the UNIX platform to Fujitsu
PC COBOL.
Already tested the code in MicroFocus PC COBOL, and it works.

The Code:
01  ws-group.
  05  ws-field1 pic xx comp-x value 1980.

I get compile errors like this:
-COMP-X CLAUSE IS ALREADY SPECIFIED
-SYNTAX OF USAGE CLAUSE IS INVALID

Any Ideas?

I work from home when I can and that's why I'm trying to use my free copy of
Fujitsu at home.
The live programs gets compiled with MicroFocus. Any other pc compiles out
there that I can use?

Thanks

Lyndon



Sun, 26 Jan 2003 03:00:00 GMT  
 COMP-X ?
Microfocus Cobol Documentation :
The PICTURE character-string of a COMPUTATIONAL-X item must consist either of
all "9"s or all "X"s. Either gives an item whose category is numeric.
Compatibility : MF (are specific to MICRO FOCUS COBOL)
Quote:

> What is COMP-X?

> I'm converting a program that was written for the UNIX platform to Fujitsu
> PC COBOL.
> Already tested the code in MicroFocus PC COBOL, and it works.

> The Code:
> 01  ws-group.
>   05  ws-field1 pic xx comp-x value 1980.

> I get compile errors like this:
> -COMP-X CLAUSE IS ALREADY SPECIFIED
> -SYNTAX OF USAGE CLAUSE IS INVALID

> Any Ideas?

> I work from home when I can and that's why I'm trying to use my free copy of
> Fujitsu at home.
> The live programs gets compiled with MicroFocus. Any other pc compiles out
> there that I can use?

> Thanks

> Lyndon



Sun, 26 Jan 2003 03:00:00 GMT  
 COMP-X ?
Just so it is clear what the MF documentation is TRYING to say - is that when
you specify

   PIC XX COMP-X

it means that you have a NUMERIC field of two bytes long.  This could be
handled in compilers without COMP-X by code such as:

  Pic S9(04) Binary

     or (depending upon big-/little-endian) on systems that have COMP-5

  Pic S9(04) Comp-5

--
Bill Klein
    wmklein <at> ix dot netcom dot com


Quote:
> Microfocus Cobol Documentation :
> The PICTURE character-string of a COMPUTATIONAL-X item must consist either
of
> all "9"s or all "X"s. Either gives an item whose category is numeric.
> Compatibility : MF (are specific to MICRO FOCUS COBOL)


> > What is COMP-X?

> > I'm converting a program that was written for the UNIX platform to
Fujitsu
> > PC COBOL.
> > Already tested the code in MicroFocus PC COBOL, and it works.

> > The Code:
> > 01  ws-group.
> >   05  ws-field1 pic xx comp-x value 1980.

> > I get compile errors like this:
> > -COMP-X CLAUSE IS ALREADY SPECIFIED
> > -SYNTAX OF USAGE CLAUSE IS INVALID

> > Any Ideas?

> > I work from home when I can and that's why I'm trying to use my free copy
of
> > Fujitsu at home.
> > The live programs gets compiled with MicroFocus. Any other pc compiles
out
> > there that I can use?

> > Thanks

> > Lyndon



Sun, 26 Jan 2003 03:00:00 GMT  
 COMP-X ?
Thanks!

Quote:
> Just so it is clear what the MF documentation is TRYING to say - is that
when
> you specify

>    PIC XX COMP-X

> it means that you have a NUMERIC field of two bytes long.  This could be
> handled in compilers without COMP-X by code such as:

>   Pic S9(04) Binary

>      or (depending upon big-/little-endian) on systems that have COMP-5

>   Pic S9(04) Comp-5

> --
> Bill Klein
> > Microfocus Cobol Documentation :
> > The PICTURE character-string of a COMPUTATIONAL-X item must consist
either
> of
> > all "9"s or all "X"s. Either gives an item whose category is numeric.
> > Compatibility : MF (are specific to MICRO FOCUS COBOL)


> > > What is COMP-X?

> > > I'm converting a program that was written for the UNIX platform to
> Fujitsu
> > > PC COBOL.
> > > Already tested the code in MicroFocus PC COBOL, and it works.

> > > The Code:
> > > 01  ws-group.
> > >   05  ws-field1 pic xx comp-x value 1980.

> > > I get compile errors like this:
> > > -COMP-X CLAUSE IS ALREADY SPECIFIED
> > > -SYNTAX OF USAGE CLAUSE IS INVALID

> > > Any Ideas?

> > > I work from home when I can and that's why I'm trying to use my free
copy
> of
> > > Fujitsu at home.
> > > The live programs gets compiled with MicroFocus. Any other pc compiles
> out
> > > there that I can use?

> > > Thanks

> > > Lyndon



Sun, 26 Jan 2003 03:00:00 GMT  
 COMP-X ?

Quote:

> Just so it is clear what the MF documentation is TRYING to say - is that when
> you specify

>    PIC XX COMP-X

> it means that you have a NUMERIC field of two bytes long.  This could be
> handled in compilers without COMP-X by code such as:

>   Pic S9(04) Binary

>      or (depending upon big-/little-endian) on systems that have COMP-5

>   Pic S9(04) Comp-5

Just wanted to note that

    PIC XX COMP-X

is also not necessarily equivalent to

    Pic S9(04) Comp-5   (or Pic S9(04) Binary)

depending on the setting of compiler directive 'TRUNC'.  :-)
--

Sun Valley Systems    http://www.sunvaley.com
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."



Sun, 26 Jan 2003 03:00:00 GMT  
 COMP-X ?
Another thing to watch with MF COMP-5 and COMP-X...

COMP-5 is stored in the processor's native byte ordering (as far as I
understand).
COMP-X is stored in a processor-independent byte ordering.

If you are passing data between processors/different machines (such as on a
client/server application betwen Intel and IBM) don't use COMP-5.  If you
are saving data to a file and possibly using different processors to read
the data don't use COMP-5.

I only use COMP-5 for temporary storage.

Regards,

Greg



Quote:
> Just so it is clear what the MF documentation is TRYING to say - is that
when
> you specify

>    PIC XX COMP-X

> it means that you have a NUMERIC field of two bytes long.  This could be
> handled in compilers without COMP-X by code such as:

>   Pic S9(04) Binary

>      or (depending upon big-/little-endian) on systems that have COMP-5

>   Pic S9(04) Comp-5

> --
> Bill Klein
>     wmklein <at> ix dot netcom dot com


> > Microfocus Cobol Documentation :
> > The PICTURE character-string of a COMPUTATIONAL-X item must consist
either
> of
> > all "9"s or all "X"s. Either gives an item whose category is numeric.
> > Compatibility : MF (are specific to MICRO FOCUS COBOL)


> > > What is COMP-X?

> > > I'm converting a program that was written for the UNIX platform to
> Fujitsu
> > > PC COBOL.
> > > Already tested the code in MicroFocus PC COBOL, and it works.

> > > The Code:
> > > 01  ws-group.
> > >   05  ws-field1 pic xx comp-x value 1980.

> > > I get compile errors like this:
> > > -COMP-X CLAUSE IS ALREADY SPECIFIED
> > > -SYNTAX OF USAGE CLAUSE IS INVALID

> > > Any Ideas?

> > > I work from home when I can and that's why I'm trying to use my free
copy
> of
> > > Fujitsu at home.
> > > The live programs gets compiled with MicroFocus. Any other pc compiles
> out
> > > there that I can use?

> > > Thanks

> > > Lyndon



Mon, 27 Jan 2003 03:00:00 GMT  
 COMP-X ?
On Wed, 9 Aug 2000 14:41:52 -0500, "Judson McClendon"

Quote:

>> Just so it is clear what the MF documentation is TRYING to say - is that when
>> you specify

>>    PIC XX COMP-X

>> it means that you have a NUMERIC field of two bytes long.  This could be
>> handled in compilers without COMP-X by code such as:

>>   Pic S9(04) Binary

>>      or (depending upon big-/little-endian) on systems that have COMP-5

>>   Pic S9(04) Comp-5

>Just wanted to note that

>    PIC XX COMP-X

>is also not necessarily equivalent to

>    Pic S9(04) Comp-5   (or Pic S9(04) Binary)

>depending on the setting of compiler directive 'TRUNC'.  :-)

I'm not familiar with either compiler, but I was wondering could the
PIC  XX  COMP-X on MF be the same as PIC 99 on Fujitsu or does COMP-X
imply some kind of data compression and/or format?

Regards,

          ////
         (o o)
-oOO--(_)--OOo-

I have six locks on my door all in a row. When I go out, I lock every
other one. I figure no matter how long somebody stands there picking the
locks, they are always locking three.

Boycott Mitsubishi Industries
For more info, please see:  
http://www.ran.org/ran/ran_campaigns/mitsubishi/background.html

Remove nospam to email me.

 Steve



Mon, 27 Jan 2003 03:00:00 GMT  
 COMP-X ?

Quote:

> I'm not familiar with either compiler, but I was wondering could the
> PIC  XX  COMP-X on MF be the same as PIC 99 on Fujitsu or does COMP-X
> imply some kind of data compression and/or format?

It is not necessary to use PIC X with COMP-X, but you can do so.
Below is from a working MF COBOL program (actually, a subroutine
that is used in many of my programs):

       01  KEYBOARD-INPUT-AREA.
           03  KIA-CHAR.
               05  KIA-DIGIT           PIC  9(02)  COMP-X.
           03  KIA-KBD-STATUS          PIC  9(02)  COMP-X VALUE 0.

The equivalent using PIC X would be:

       01  KEYBOARD-INPUT-AREA.
           03  KIA-CHAR.
               05  KIA-DIGIT           PIC  X(01)  COMP-X.
           03  KIA-KBD-STATUS          PIC  X(01)  COMP-X VALUE 0.

I have a visceral dislike for using 'X' for numeric fields. :-)
--

Sun Valley Systems    http://www.sunvaley.com
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."



Mon, 27 Jan 2003 03:00:00 GMT  
 COMP-X ?
PIC XX COMP-X is NOT equivalent to PIC 99 COMP-X (yuck !!!)

PIC XX COMP-X says to allocate two bytes and fill it with as large a
(non-truncated) binary field that will fit in two bytes.

Pic 99 Comp-X says - figure out how many bytes it takes to store the value 99
in binary.  Then allocate that much storage (probably one byte) for the
numeric field and allow ANY non-truncated numeric value in that field.

--
Bill Klein
    wmklein <at> ix dot netcom dot com

Quote:
> On Wed, 9 Aug 2000 14:41:52 -0500, "Judson McClendon"


> >> Just so it is clear what the MF documentation is TRYING to say - is that
when
> >> you specify

> >>    PIC XX COMP-X

> >> it means that you have a NUMERIC field of two bytes long.  This could be
> >> handled in compilers without COMP-X by code such as:

> >>   Pic S9(04) Binary

> >>      or (depending upon big-/little-endian) on systems that have COMP-5

> >>   Pic S9(04) Comp-5

> >Just wanted to note that

> >    PIC XX COMP-X

> >is also not necessarily equivalent to

> >    Pic S9(04) Comp-5   (or Pic S9(04) Binary)

> >depending on the setting of compiler directive 'TRUNC'.  :-)

> I'm not familiar with either compiler, but I was wondering could the
> PIC  XX  COMP-X on MF be the same as PIC 99 on Fujitsu or does COMP-X
> imply some kind of data compression and/or format?

> Regards,

>           ////
>          (o o)
> -oOO--(_)--OOo-

> I have six locks on my door all in a row. When I go out, I lock every
> other one. I figure no matter how long somebody stands there picking the
> locks, they are always locking three.

> Boycott Mitsubishi Industries
> For more info, please see:
> http://www.ran.org/ran/ran_campaigns/mitsubishi/background.html

> Remove nospam to email me.

>  Steve



Mon, 27 Jan 2003 03:00:00 GMT  
 COMP-X ?
On Thu, 10 Aug 2000 17:15:39 -0500, "William M. Klein"

Quote:
>PIC XX COMP-X is NOT equivalent to PIC 99 COMP-X (yuck !!!)

>PIC XX COMP-X says to allocate two bytes and fill it with as large a
>(non-truncated) binary field that will fit in two bytes.

>Pic 99 Comp-X says - figure out how many bytes it takes to store the value 99
>in binary.  Then allocate that much storage (probably one byte) for the
>numeric field and allow ANY non-truncated numeric value in that field.

You misunderstood my question due to my not being percise but answered
it anyway!

What I meant to ask was PIC XX COMP-X the same as PIC 99 (no comp).
But you state it is a binary number, so I see it is indeed not the
same.

Regards,

          ////
         (o o)
-oOO--(_)--OOo-

I have six locks on my door all in a row. When I go out, I lock every
other one. I figure no matter how long somebody stands there picking the
locks, they are always locking three.

Boycott Mitsubishi Industries
For more info, please see:  
http://www.ran.org/ran/ran_campaigns/mitsubishi/background.html

Remove nospam to email me.

 Steve



Tue, 28 Jan 2003 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. comp.infosystems.harvest,comp.graphics.apps.avs,comp.lang.javascript,comp.publish.prepress,comp.lang.fortran

2. Is there any better way to convert mainframe Comp-3 or comp data type into UNIX or NT comp-3 or comp data?

3. Comp.Lang.Clarion and Comp.Lang.Clarion

4. comp.lang.eiffel comp.object

5. according to comp.realtime and comp.robotics sources...

6. comp.lang.forth and Comp.lang.pop

7. archives for comp.lang.forth and comp.lang.forth.mac

8. comp.realtime comp.lang.misc

9. RFD: comp.lang.ruby (getting Ruby out of comp.lang.misc)

10. 2nd RFD: comp.org.lisp-users and comp.std.lisp

11. CFV: comp.std.lisp moderated and comp.org.lisp-users

12. *** COPIED FROM: >>>Usenet/comp.arch.embe 3009 lfoss@cix.comp(1712)13Nov95 21:47

 

 
Powered by phpBB® Forum Software