View previous topic :: View next topic |
Author |
Message |
nbdtrjk1 Beginner
Joined: 12 Apr 2007 Posts: 76 Topics: 41
|
Posted: Thu Apr 08, 2010 5:53 am Post subject: How to store sign byte via easytrieve |
|
|
All,
How to store sign byte via easytrieve program?
in cobol
Code: | 01 X13 PIC S9(13)V99.
MOVE 1234567890123.12 TO X13
DISPLAY X13
SYSOUT DISPLAYS;
12345678901231B
FFFFFFFFFFFFFFC
123456789012312 |
same way how to achieve via easytrieve(singed byte)? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Apr 08, 2010 10:21 am Post subject: |
|
|
nbdtrjk1,
untested code
Code: |
X13 15 N 2
X13 = 123456789012312
|
Kolusu |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Thu Apr 08, 2010 2:15 pm Post subject: |
|
|
Quote: | How to store sign byte via easytrieve program? | I must not understand something. . .
This is a signed zoned-decimal value. . . Code: |
12345678901231B
FFFFFFFFFFFFFFC
123456789012312
|
_________________ All the best,
di |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Mon Apr 12, 2010 11:08 am Post subject: |
|
|
Quote: |
This is a signed zoned-decimal value. . .
|
This is what you get if you don't specify 'SIGN IS SEPERATE' clause |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Apr 12, 2010 11:27 am Post subject: |
|
|
papadi wrote: | Quote: | How to store sign byte via easytrieve program? | I must not understand something. . .
This is a signed zoned-decimal value. . . Code: |
12345678901231B
FFFFFFFFFFFFFFC
123456789012312
|
|
papadi,
OP showed the results in COBOL and he wants to do the same in Easytrieve now. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Apr 12, 2010 3:41 pm Post subject: |
|
|
Using this: Code: |
//SYSPRINT DD SYSOUT=*
//OUTFILE DD SYSOUT=*
//SYSIN DD *
*
FILE OUTFILE FB(80 80)
STUFF 1 1 A
OZNDFLD 2 8 N 2
DEFINE PKDFLD W 5 P 2 VALUE 123
DEFINE ZNDFLD W 8 N 2
JOB INPUT NULL
ZNDFLD = PKDFLD
OZNDFLD = PKDFLD
PUT OUTFILE
DISPLAY PKDFLD
DISPLAY ZNDFLD
*
ZNDFLD = PKDFLD * -1
OZNDFLD = PKDFLD * -1
PUT OUTFILE
DISPLAY PKDFLD
DISPLAY ZNDFLD
STOP |
will generate a SYSPRINT of: Code: |
123.00
123.00
123.00
123.00- |
and an OUTFILE of:
Not very elegant, but Does this do what is needed? _________________ All the best,
di |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Apr 12, 2010 4:57 pm Post subject: |
|
|
All.
Hmm I am not sure why this thread was even updated when OP hasn't come back to claim that the proposed solution in my post doesn't work. It just adds confusion. Please don't confuse people
Thanks
Kolusu |
|
Back to top |
|
|
nbdtrjk1 Beginner
Joined: 12 Apr 2007 Posts: 76 Topics: 41
|
Posted: Tue Apr 13, 2010 2:08 am Post subject: |
|
|
All,
Sorry for the late reply.
As per Papadi's code, i am able to get the Negative(D) sign byte. but how to get positive(C) sign byte?. I tried below code
Code: | ZNDFLD = PKDFLD * +1
OZNDFLD = PKDFLD * +1
i am getting below output
00012300
FFFFFFFF
00012300 |
as per above statement i am not getting +(C) sign byte |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Tue Apr 13, 2010 3:13 pm Post subject: |
|
|
Other than personal preference, why will the F sign not work?
Hopefully, no one has implemented a key that uses a signed value. . .
I don't know if it matters as far as generating the sign, but which release of Easytrieve is being used? _________________ All the best,
di |
|
Back to top |
|
|
|
|