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

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


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Dec 03, 2013 4:01 pm
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: 2455
Location: Hampshire, UK

PostPosted: Tue Dec 03, 2013 5:21 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Dec 03, 2013 5:33 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Dec 03, 2013 6:20 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Tue Dec 03, 2013 7:48 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Dec 03, 2013 7:59 pm
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
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Fri Dec 06, 2013 5:44 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Mon Dec 09, 2013 6:20 pm
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

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Mon Dec 09, 2013 6:36 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Dec 09, 2013 6:41 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
Search our Forums:

Back to Top