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

what does '+' mean in following code?


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

New User


Joined: 01 May 2006
Posts: 9

PostPosted: Tue May 02, 2006 10:55 am
Reply with quote

what does '+' mean in all the three places in the following code?

05 WC-ABEND-SQLSTAT PIC +++9.
.
.
.
.
03 WS-SQL-RETURN-CODE PIC S9(4).
88 WC-SQL-SUCCESS VALUE +0.
88 WC-SQL-NO-ROW VALUE +100.
88 WC-END-OF-FETCH VALUE +100.
88 WC-SQL-ACCEPTABLE-RETURN VALUE 0, +100.
.
.
.
.
03 WD-DISPLAY-SQLCODE PIC +++++++++9

[/b]
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue May 02, 2006 2:47 pm
Reply with quote

Dont know why put up multiple '+' signs when a single can do what is needed.

Regards,
Priyesh.
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Tue May 02, 2006 3:03 pm
Reply with quote

In the first and the last case the +++9 can store a value of 9(4) and if its having a value of 999 then its going to display +999.


Correct me if I am wrong.

Thanks
Shri
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue May 02, 2006 3:33 pm
Reply with quote

Quote:
In the first and the last case the +++9 can store a value of 9(4)

Did you check that... moving a value of 9999 in +++9 would truncate one bit from left in the destination string.

Regards,
Priyesh.
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Tue May 02, 2006 4:00 pm
Reply with quote

I never tried this.

You may be correct.

Thanks
Shri
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed May 03, 2006 5:37 am
Reply with quote

Quote:
Dont know why put up multiple '+' signs when a single can do what is needed.

Not if you want a floating sign.

+++9 value 123 will give you +123 when displayed or printed; +++9 value 3 will give you +3.

+999 value 3 will give you +003.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed May 03, 2006 9:11 am
Reply with quote

Oh Jack... Thanks a lot... for clearing the doubt...

Regards,
Priyesh.
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Wed May 10, 2006 5:40 pm
Reply with quote

Hi niharika1234,

Multiple '+' sign in your code is edit mask character. This are most commonly used with the fields pertaining to reports etc.

You might have noticed that in the VALUE clauses of your code there are no multiple '+' signs.

Some of the other edit characters are :
! . , / B 0 $ * Z + - CR DB A X 9 S V P
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Monitoring production job progress. N... JCL & VSAM 4
Search our Forums:

Back to Top