Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
edit formats

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

New User


Joined: 31 Oct 2006
Posts: 83
Location: brisbane

PostPosted: Tue Sep 08, 2020 9:40 am    Post subject: edit formats
Reply with quote

I have a requirment to map a data element to SPACES if it is 0, else show two decimal places of precision.

eg,
0 => SPACES
1.5 => 1.50
.15 => 0.15

so with WS-temp as PIC Z(6)9.99, WS-out as PIC X(10) I could do something like:

init ws-out to SPACES
if ws-myVar > 0
move ws-myVar to ws-temp
move ws-temp to ws-out
end-if

is there a better / more elegant way of doing this ?
Back to top
View user's profile Send private message

John Del

New User


Joined: 27 Apr 2012
Posts: 40
Location: NY

PostPosted: Tue Sep 08, 2020 12:01 pm    Post subject:
Reply with quote

Editing clause BLANK WHEN ZERO
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Tue Sep 08, 2020 8:21 pm    Post subject:
Reply with quote

I don't see anything bad with what you are doing. You could do redefine instead of move if you think better icon_smile.gif
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 ISPF Edit Macro with profile commands... Lynne Schuler TSO/ISPF 14 Thu Jun 18, 2020 7:25 pm
No new posts Need to open a DSN using REXX & e... Y Marwaha CLIST & REXX 10 Fri Jun 05, 2020 7:30 pm
No new posts Execute Partially Edited Rexx Exec fr... AllenSieracki CLIST & REXX 14 Tue Jun 02, 2020 7:56 pm
No new posts ISPF Edit Macro for modifying JCL Cameron Conacher TSO/ISPF 21 Wed Dec 11, 2019 7:01 pm
No new posts Training on numeric fields data formats sergeyken SYNCSORT 12 Thu Aug 01, 2019 8:15 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us