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 

SIgn is leading separate

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


Joined: 14 Mar 2008
Posts: 7
Topics: 2
Location: Pretoria, SA

PostPosted: Mon Apr 07, 2008 6:24 am    Post subject: SIgn is leading separate Reply with quote

Hi all,

Please could you assist me,

I need to calculate the amount of bytes taken by the following fields,

01 NUMBER-1 PIC S9(4) SIGN LEADING SEPARATE.
01 NUMBER-2 PIC S9(4).

I KNOW THAT I ACTUALLY LEARNED THIS WHEN IS DID MY PROGRAMMING COURSE BUT HAD AN ARGUMENT WITH SOMEBODY AT WORK ABOUT IT,

THANKS IN ADVANCE,
Back to top
View user's profile Send private message
johngo_za
Beginner


Joined: 14 Mar 2008
Posts: 7
Topics: 2
Location: Pretoria, SA

PostPosted: Mon Apr 07, 2008 6:37 am    Post subject: Reply with quote

I found the following:
=====================================================
The SIGN clause can be specified only for a signed numeric data description entry (that is, one whose PICTURE character-string contains an S) or for a group item that contains at least one such elementary entry. USAGE IS DISPLAY must be specified explicitly or implicitly. If a SIGN clause is specified in either an elementary or group entry subordinate to a group item for which a SIGN clause is specified, the SIGN clause for the subordinate entry takes precedence for the subordinate entry. If you specify the CODE-SET clause in an FD entry, any signed numeric data description entries associated with that file description entry must be described with the SIGN IS SEPARATE clause. The SIGN clause is required only when an explicit description of the properties or position of the operational sign is necessary. When specified, the SIGN clause defines the position and mode of representation of the operational sign for the numeric data description entry to which it applies, or for each signed numeric data description entry subordinate to the group to which it applies. If the SEPARATE CHARACTER phrase is not specified, then: v The operational sign is presumed to be associated with the LEADING or TRAILING digit position, whichever is specified, of the elementary numeric data item. (In this instance, specification of SIGN IS TRAILING is the equivalent of the standard action of the compiler.) v The character S in the PICTURE character string is not counted in determining the size of the item (in terms of standard data format characters). If the SEPARATE CHARACTER phrase is specified, then: v The operational sign is presumed to be the LEADING or TRAILING character position, whichever is specified, of the elementary numeric data item. This character position is not a digit position. v The character S in the PICTURE character string is counted in determining the size of the data item (in terms of standard data format characters). v + is the character used for the positive operational sign. v - is the character used for the negative operational sign

=====================================================

If I am interpreting this correctly then NUMBER-1 will be 5 bytes long and NUMBER-2 will be 4 bytes long.

Am I correct in my interpretation?

Thanks
John
Back to top
View user's profile Send private message
jyoung
Beginner


Joined: 10 Nov 2005
Posts: 36
Topics: 2
Location: Flint, MI

PostPosted: Mon Apr 07, 2008 7:55 am    Post subject: Reply with quote

I count them both as 5 bytes long due to the sign. The "Sign leading separate" phrase should not make a difference when determining what number of bytes are used to store the value.
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Mon Apr 07, 2008 8:24 am    Post subject: Reply with quote

Hi iyoung,

I'm afraid you're mistaken:

A DISPLAY NUMERIC field [PIC S9(4).] has an integrated sign and 4 bytes (F0F0F0C1) for a value of +1; the corresponding SIGN IS TRAILING SEPARATE variable generates a separate sign (4E) and a 5 byte value (F0F0F0F14E) for +1.
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
jyoung
Beginner


Joined: 10 Nov 2005
Posts: 36
Topics: 2
Location: Flint, MI

PostPosted: Tue Apr 08, 2008 7:26 am    Post subject: Reply with quote

Hi Slade,
Don't be afraid when you are correct. Thank you for correcting my mistake. Must have had a brain fart. I don't know what I was thinking.
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Tue Apr 08, 2008 12:56 pm    Post subject: Reply with quote

Hi iyoung,

Thank you for your gracious reply.
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
johngo_za
Beginner


Joined: 14 Mar 2008
Posts: 7
Topics: 2
Location: Pretoria, SA

PostPosted: Thu Apr 10, 2008 3:48 am    Post subject: Reply with quote

Thanks to both of you Very Happy
Back to top
View user's profile Send private message
Crox
Beginner


Joined: 29 May 2004
Posts: 52
Topics: 9

PostPosted: Thu Apr 10, 2008 5:50 pm    Post subject: Reply with quote

The compiler tells you also how long the field is in two ways: in the listing and using the LENGTH OF statement.
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