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
 

 

Space in PIC ZZ.99

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Thu Apr 02, 2009 4:24 pm    Post subject: Space in PIC ZZ.99
Reply with quote

Hi,

Refer the lines:

FILLER PIC X '('
S1-Amount PIC ZZ.99
FILLER PIC X ')'


My value is 5.99. i want to display (5.99) , but it is coming ( 5.99). A space is coming after the opening bracket.

Can anybody please suggest how can i do this directy using the PIC clause or the simplest way?
Back to top
View user's profile Send private message

himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Apr 02, 2009 4:44 pm    Post subject:
Reply with quote

This is because you are using ZZ which is zero supressing.


Plz try with z.99 if your value will always be 9.99.
Back to top
View user's profile Send private message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Thu Apr 02, 2009 5:22 pm    Post subject: Reply to: Space in PIC ZZ.99
Reply with quote

Thanks Rajveer for your suggestion.

But i cannot use Z.99 because the value can also be greater than 9.
I just wanted to know that whether in Zero suppression, is there any way that solve my purpose i.e. i want (5.99)...

Hope you understand what want to say......

Thanks once again...

Your suggestion are always welcome.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8120
Location: East Dubuque, Illinois, USA

PostPosted: Thu Apr 02, 2009 5:27 pm    Post subject:
Reply with quote

You'll need to use REDEFINES to define the field as (Z.99) if less than 10 and (ZZ.99) if greater than 10.
Back to top
View user's profile Send private message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Thu Apr 02, 2009 5:42 pm    Post subject: Reply to: Space in PIC ZZ.99
Reply with quote

k....
I also thought the same way......means there is no way we can change using the PIC clause...
We have to use REDIFINES...and in the code we have to write the logic for it.

Am i Correct?????
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8120
Location: East Dubuque, Illinois, USA

PostPosted: Thu Apr 02, 2009 5:54 pm    Post subject:
Reply with quote

Yes ... if you define the PIC as ZZ.99 it has 5 bytes and that cannot be changed dynamically. You'll have to use REDEFINES and code for which variable to use.
Back to top
View user's profile Send private message
rkyzhu

New User


Joined: 08 Feb 2009
Posts: 1
Location: shanghai of china

PostPosted: Thu Apr 02, 2009 6:01 pm    Post subject:
Reply with quote

the easiest way is to define two fields:
FILLER PIC X '('
S1-Amount PIC ZZ.99
FILLER PIC X ')'

and

FILLER PIC X '('
S1-Amount PIC Z.99
FILLER PIC X ')'


then evaluate which one will be used in your program
Back to top
View user's profile Send private message
chhabraravneet

New User


Joined: 04 Oct 2007
Posts: 49
Location: Mumbai

PostPosted: Thu Apr 02, 2009 7:22 pm    Post subject: Reply to: Space in PIC ZZ.99
Reply with quote

Thanks all for your valuable suggesstion.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Apr 03, 2009 2:55 pm    Post subject:
Reply with quote

Hi,

If you share the final solution used, it might help others, Thanks.

Ad
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 VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
This topic is locked: you cannot edit posts or make replies. Need help in estimating space of unlo... ashek15 IMS DB/DC 12 Fri Apr 07, 2017 5:11 am
No new posts Need inputs on Space requirement and... ashek15 IMS DB/DC 0 Sat Apr 01, 2017 8:26 am
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm
No new posts How to find Table-space and Index-spa... venksiv DB2 5 Wed Feb 03, 2016 6:16 pm


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