View previous topic :: View next topic
|
Author |
Message |
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi,
I am analysing one program and found that there is something called as 'SIGN LEADING SEPARATE'. I tried to sort t his out but couldnt get that.
Can any body help me in this??
Thanks
Ap_mainframes |
|
Back to top |
|
|
Jerry
New User
Joined: 16 Sep 2005 Posts: 42
|
|
|
|
Hi Ap_mainframes,
Here is an explanation from a manual for SIGN LEADING SEPARATE Clause:
"If you plan to port your program or data to a different machine, you
might want to code the sign as a separate position in storage.
05 Price Pic s99V99 Sign Is Leading, Separate.
In this case, the sign takes 1 byte.
This coding ensures that the convention your machine uses for storing a
nonseparate sign will not cause unexpected results on a machine that uses a different convention. Separate signs are also preferable for data items that will be printed or displayed."
Hope this addresses your query.
Correct me if I am wrong.
Regards,
Jerry. |
|
Back to top |
|
|
vidhyanarayanan
New User
Joined: 23 Dec 2005 Posts: 52
|
|
|
|
hi,
It is applicable when the picture string contains "s" .
eg.;
take a number -125
sign leading j25
sign leading seperate -125
its based on the calculation +1=A, +2=B...........+9=I
-1=J, -2=K...............-9=R
let me kno if u wan more details. |
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi Vidhya,
This is still not very clear to me. And I have many queries....
Why would you want to use it???
Like jerry said , Is it all about porting a program??
What exactly is leading doing and what exactly is separate doing???
How is the storage done here???
Can you pass on a document ( if you have one ) regarding this??
ap_mainframes |
|
Back to top |
|
|
vidhyanarayanan
New User
Joined: 23 Dec 2005 Posts: 52
|
|
|
|
hi,
This is mainly to store the sign bit as seperate or overlapped.....
if u didnt mention anything, default value "sign trailing with
no seperate character. In this 's' does not take any space.....it is
stored along with the last digit.
we are using many clauses in cobol pgm, this is also a type of clause....
take the same example : -125
sign leading seperate means "sign is leading and it shd be a seperate
character" so, -125 becomes -125
sign leading means " sign is leading and it shd not be a seperare char
so, -125 becomes j25 ( -1 = j)
sign trailing means sign is at the trailing end and it shd not be a
seperate character" so, -125 becomes 12N (-5 = N)
HOPE THIS WILL HELP U...... |
|
Back to top |
|
|
M.Bhavani Prasad
New User
Joined: 10 Mar 2006 Posts: 6 Location: Hyderabad
|
|
|
|
vidhyanarayanan wrote: |
hi,
This is mainly to store the sign bit as seperate or overlapped.....
if u didnt mention anything, default value "sign trailing with
no seperate character. In this 's' does not take any space.....it is
stored along with the last digit.
we are using many clauses in cobol pgm, this is also a type of clause....
take the same example : -125
sign leading seperate means "sign is leading and it shd be a seperate
character" so, -125 becomes -125
sign leading means " sign is leading and it shd not be a seperare char
so, -125 becomes j25 ( -1 = j)
sign trailing means sign is at the trailing end and it shd not be a
seperate character" so, -125 becomes 12N (-5 = N)
HOPE THIS WILL HELP U...... |
|
|
Back to top |
|
|
vidhyanarayanan
New User
Joined: 23 Dec 2005 Posts: 52
|
|
|
|
hi M.Bhavani Prasad,
You are right, This is for sign representation -whether ur need is to
store the bit as seperate character or the overlapped one.... |
|
Back to top |
|
|
aditya_anand
New User
Joined: 01 Sep 2008 Posts: 1 Location: Pune
|
|
|
|
Hi,
What happens if the character is 0 as the last digit.
Thanks,
Aditya. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Aditya and welcome to the forums,
Quote: |
What happens if the character is 0 as the last digit. |
For a signed zoned-decimal number, the sign will be the high-order nibble (1/2 byte) of the low-order digit.
If a field is pic s9(3) and the value is +123, the field content will appear as 12C in a file. If the value were -123, the field content will appear as 12L in a file. The hex value for +123 in a zoned-decimal field is x'F1F2C3', the negative 123 is 'F1F2D3'.
The same applies to zero except that the value is not a letter. The letters A-I are for a positive 1 thru 9. The letters J-R are for a negative 1 thru 9. The hex for +120 is x'F1F2C0' and for the -120, x'F1F2D0'. |
|
Back to top |
|
|
|