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 

Conversion from PD to ZD doesn't retain sign.

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


Joined: 18 Apr 2016
Posts: 47
Topics: 15

PostPosted: Fri Jul 09, 2021 12:03 pm    Post subject: Conversion from PD to ZD doesn't retain sign. Reply with quote

Good day everyone, thought it should be an easy task, but missing something.

Need to convert a S9(10)V99 COMP-3 value to S9(9)V99 with a C or D sign bit in the last byte.
Used this in DFSOrt but losing a sign somewhere.
OUTREC FIELDS=(1,7,PD,TO=ZD,LENGTH=11)

Input field.
Code:
0000200
000150C


Received output.
Code:
00000125000
FFFFFFFFFFF
00000125000


Desired output.
Code:
0000012500{
FFFFFFFFFFC
00000125000


Appreciate any help. Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Jul 09, 2021 12:12 pm    Post subject: Reply with quote

ramy2016,

DFSORT does indeed retain the sign. F is a positive sign. If you need C as positive sign you need to use ZDC instead of ZD as ZD or ZDF output, F is used as the positive sign and D is used as the negative sign. For ZDC output, C is used as the positive sign.

Also a 7 byte PD field can have upto 14 digits in display format. Why are you just limiting to 11?

Code:
OUTREC FIELDS=(1,7,PD,TO=ZDC,LENGTH=14)

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ramy2016
Beginner


Joined: 18 Apr 2016
Posts: 47
Topics: 15

PostPosted: Fri Jul 09, 2021 12:29 pm    Post subject: Reply with quote

Thank you kolusu, that worked perfectly.
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 -> Utilities 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