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
 

 

how to define decimals in cics map using SDF functionality??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Dec 03, 2013 4:01 pm    Post subject: how to define decimals in cics map using SDF functionality??
Reply with quote

Hi,

I'm developing a cics screen using SDF functionality. I want to add a field with pic as

business percentage : _ _ _ _ _ % (NN.NN)

I have declared as numeric in SDF Functionality tool.
But the problem i'm facing is i have to
1) Convert the percentage into value and update into db2 table
2) Convert the value in db2 (ex: 1.33333) and convert into percentage (13%)and populate into cics screen.

How I have coded:

Initially in cics map copy book the above fields pic is being generated
as x(05). and i have coded as below. Please let me if i'm correct:



Code:


01 WS-BUS-COMMISSION.                                       
   05 WS-BUS-HUNDRED         PIC 9(03)  VALUE 100.         
   05 WS-BUS-COMM-PERCENT    PIC S9(2)V99 USAGE COMP-3.     
   05 WS-BUS-PERCENT-VALUE   PIC S9(1)V9(5) USAGE COMP-3.   

01 IN-NEW-BUS-COMM PIC S9(01)V9(5)   USAGE COMP-3.


                                                           
DIVIDE  WS-HUNDRED INTO WS-BUS-COMM-PERCENT     
                   GIVING  WS-BUS-PERCENT-VALUE
MOVE WS-BUS-COMM-PERCENT     TO IN-NEW-BUS-COMM  (db2 field)
                                                         






please let me know if i have done correct from starting.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Tue Dec 03, 2013 5:21 pm    Post subject:
Reply with quote

What happens when you try it? Trying things is part testing.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Dec 03, 2013 5:33 pm    Post subject: Reply to: how to define decimals in cics map using SDF funct
Reply with quote

Review the BMS DFHMDF Macro sub-field definitions PICIN and PICOUT (for COBOL and PL/I only).

Note: I'm not that SDF literate....
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Dec 03, 2013 6:20 pm    Post subject: how to define decimals in cics map using SDF functionality?
Reply with quote

Nic Clouston wrote:
What happens when you try it? Trying things is part testing.


Hi Nic,
I dont have access to test the screens for now...thats y i have posetd over here...thanks...please sugegst if you have any idea on the same....
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Tue Dec 03, 2013 7:48 pm    Post subject: Re: Reply to: how to define decimals in cics map using SDF f
Reply with quote

Bill O'Boyle wrote:
Review the BMS DFHMDF Macro sub-field definitions PICIN and PICOUT (for COBOL and PL/I only).

Note: I'm not that SDF literate....


hi,

as i declared numeric in the sdf facility the picture clause for the respective field waas generated as pic 9(05) in the copy book.

how to declare as decimal in sdf ???
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Dec 03, 2013 7:59 pm    Post subject: Reply to: how to define decimals in cics map using SDF funct
Reply with quote

As far as BMS numeric declarations, PIC 9 will be generated when PICIN or PICOUT are defined to the DFHMDF Macro field.

As I said, I'm not that SDF literate. Perhaps another member can assist?
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Thu Dec 05, 2013 8:20 pm    Post subject:
Reply with quote

Use the Panel Editor Dialog within SDFII. Then choose option 5 (STRUCTURE) to define the data structure attributes. Now you can define the PICTURE clauses to be used for the input and the output structure in the COBOL copybooks.
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Fri Dec 06, 2013 5:44 pm    Post subject:
Reply with quote

Stefan wrote:
Use the Panel Editor Dialog within SDFII. Then choose option 5 (STRUCTURE) to define the data structure attributes. Now you can define the PICTURE clauses to be used for the input and the output structure in the COBOL copybooks.


Hi Stefan,

Thanks a lot!!!

I'm learning a lot from this forum... icon_smile.gif
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Mon Dec 09, 2013 6:20 pm    Post subject:
Reply with quote

Stefan wrote:
Use the Panel Editor Dialog within SDFII. Then choose option 5 (STRUCTURE) to define the data structure attributes. Now you can define the PICTURE clauses to be used for the input and the output structure in the COBOL copybooks.


hI Stefan,

I have declared with 9(2)v99. which means length is 4 in cics map.
when i'm trying to enter 12.34 then its not accepting as above....till 12.3 only its accepting how can i do this?????means entering 12.34
Back to top
View user's profile Send private message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Mon Dec 09, 2013 6:36 pm    Post subject:
Reply with quote

ram_vizag wrote:
Stefan wrote:
Use the Panel Editor Dialog within SDFII. Then choose option 5 (STRUCTURE) to define the data structure attributes. Now you can define the PICTURE clauses to be used for the input and the output structure in the COBOL copybooks.


hI Stefan,

I have declared with 9(2)v99. which means length is 4 in cics map.
when i'm trying to enter 12.34 then its not accepting as above....till 12.3 only its accepting how can i do this?????means entering 12.34


also , when i'm declaring x(5) in map attrributes and how if changing the structure in sdf as 9(2)v99 the compilation error is coming for map??

please suggest
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Mon Dec 09, 2013 6:41 pm    Post subject:
Reply with quote

In COBOL, the V in a PICTURE clause is an implied decimal point -- as in, it does not really exist. If you are using PIC X(05), your corresponding decimal PICTURE should be PIC 9(02).99 -- which is five characters, not four. Of course, you will then have problems if your user does NOT put a decimal point in the third character.
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm


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