Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Whats the use of Sign Clause.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Whats the use of Sign Clause.
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Vidhya,can i think this is mainly for the sign representatin
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Sat Sep 06, 2008 6:10 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts [SQL0029] INTO clause missing from em... HABBIE DB2 2 Fri Sep 04, 2015 3:54 pm
No new posts Whats the assambler code for SUBSTR()... jackzhang75 PL/I & Assembler 3 Sat Aug 29, 2015 1:59 am
No new posts 3-D Table with nested DEPENDING ON Cl... VivekKhanna COBOL Programming 5 Sat Aug 08, 2015 11:18 pm
No new posts IGZ0040S An invalid separate sign was... kishpra COBOL Programming 13 Sun Aug 02, 2015 2:41 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us