MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to store sign byte via easytrieve

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
nbdtrjk1
Beginner


Joined: 12 Apr 2007
Posts: 76
Topics: 41

PostPosted: Thu Apr 08, 2010 5:53 am    Post subject: How to store sign byte via easytrieve Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Apr 08, 2010 10:21 am    Post subject: Reply with quote

nbdtrjk1,

untested code

Code:

X13        15 N 2

X13 = 123456789012312



Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Thu Apr 08, 2010 2:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Mon Apr 12, 2010 11:08 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Apr 12, 2010 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Mon Apr 12, 2010 3:41 pm    Post subject: Reply with quote

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:
Code:

00012300
0001230}


Not very elegant, but Does this do what is needed?
_________________
All the best,

di
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Apr 12, 2010 4:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
nbdtrjk1
Beginner


Joined: 12 Apr 2007
Posts: 76
Topics: 41

PostPosted: Tue Apr 13, 2010 2:08 am    Post subject: Reply with quote

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
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Tue Apr 13, 2010 3:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group