View previous topic :: View next topic |
Author |
Message |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Jul 19, 2010 3:21 pm Post subject: |
|
|
prog_mario,
i am afraid you are going to have to look at the manual and determine the syntax for defining 5 bytes of hexidecimal FF.
you could try defining a working storage field as 5 bytes char with a value clause for a hex 'FFFFFFFFFF'. then you could use the working storage field in your code instead of the literal. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Jul 19, 2010 3:23 pm Post subject: |
|
|
As an experiment, redefine the variable as a 5-byte binary number and move 1099511627775 to that variable (or use 5 1-byte binary numbers and move 255 to each of the 5.
After the move(s) the char(5) field will contain F's. . . _________________ All the best,
di |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Jul 19, 2010 3:47 pm Post subject: |
|
|
last guess:
you use ' ' for a literal and also " " for a literal.
try x"FFFFFFFFFF" and "FFFFFFFFFF"X
papadi
can you define a 1 byte binary field in VisualAge Cobol.
you can't in COBOL II or E-COBOL, both of which are IBM. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Jul 19, 2010 3:59 pm Post subject: |
|
|
Good catch
About Visual Age - don't know. . .
With Enterprise COBOL, the low-order byte of a 2-byte comp field works well 8) _________________ All the best,
di |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Jul 19, 2010 4:38 pm Post subject: |
|
|
yes, the right hand side of a two byte binary field would contain X'FF' if you VALUE 255 for the the two byte binary field.
then move the right hand byte to each of the 5 bytes of the PIC x(5) field.
also, can you define 5 bytes of binary? I thought only 2, 4 and 8.
and wouldn't 1099511627775 require PIC S9(13) COMP, thus 8 bytes. I guess you could redefine the last 5 as PIC X,
but it would be somuch easier to figure out how to define a hex literal. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Jul 19, 2010 5:17 pm Post subject: |
|
|
Quote: | but it would be somuch easier to figure out how to define a hex literal.
| Yup, it surely should, but that appeared to be non-trivial from the dialog, so. . . _________________ All the best,
di |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Jul 19, 2010 5:59 pm Post subject: |
|
|
yes,
much easier to ask the question on a website
than look at documentation.
but in all fairness to the TS,
his native tongue is Portugese
and all documentation is probably english or spanish.
I know that I have a hard time going through german text books,
not always knowing the german equivalent of an english keyword. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
prog_mario Beginner
Joined: 08 Sep 2007 Posts: 86 Topics: 27
|
Posted: Thu Jul 22, 2010 10:58 am Post subject: |
|
|
Thanks a lot everybody. I just changed the logic to avoid the high-values. _________________ The more I learn, the more I want to learn. |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Thu Jul 22, 2010 3:59 pm Post subject: |
|
|
Well, sometimes the work just needs to get done 8)
I would recommend that you pursue how to do what you originally wanted - there may be a time it (or something similar) actually must be done. _________________ All the best,
di |
|
Back to top |
|
|
|
|