IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Whats the use of Sign Clause.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Mon Apr 17, 2006 3:05 pm
Reply with quote

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

New User


Joined: 16 Sep 2005
Posts: 42

PostPosted: Mon Apr 17, 2006 4:26 pm
Reply with quote

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

New User


Joined: 23 Dec 2005
Posts: 52

PostPosted: Mon Apr 17, 2006 4:29 pm
Reply with quote

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

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Tue Apr 18, 2006 9:25 am
Reply with quote

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

New User


Joined: 23 Dec 2005
Posts: 52

PostPosted: Tue Apr 18, 2006 9:50 am
Reply with quote

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
View user's profile Send private message
M.Bhavani Prasad

New User


Joined: 10 Mar 2006
Posts: 6
Location: Hyderabad

PostPosted: Mon Apr 24, 2006 3:16 pm
Reply with quote

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

New User


Joined: 23 Dec 2005
Posts: 52

PostPosted: Mon Apr 24, 2006 3:30 pm
Reply with quote

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

New User


Joined: 01 Sep 2008
Posts: 1
Location: Pune

PostPosted: Fri Sep 05, 2008 3:04 pm
Reply with quote

Hi,

What happens if the character is 0 as the last digit.

Thanks,
Aditya.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Sep 06, 2008 6:10 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. Missing Negative sign in COBOL COBOL Programming 6
No new posts NOT IN clause in COBOL pgm COBOL Programming 8
No new posts SUSBSCRIPT WITH SIGN IN PIC CLAUSE COBOL Programming 3
No new posts Typing the CENT sign ยข on mainframe,... All Other Mainframe Topics 2
Search our Forums:

Back to Top