View previous topic :: View next topic
|
Author |
Message |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
What happens when you try it? Trying things is part testing. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
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 |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
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 |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
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... |
|
Back to top |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
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 |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|