View previous topic :: View next topic
|
Author |
Message |
k.saravanan
New User
Joined: 12 Mar 2005 Posts: 1
|
|
|
|
We are Using CICS For Data Collection. I dont know how to retrieve a Decimal Values From the Map.
I used PICIN and PICOUT of DFHMDF,
Since i am using that i am unable to Retrieve the Decimal Point which i entered in the bms.
Tell, Is this proper way or Suggest me Some other method to retrive the Decimal values from the map.
regards,
saravanan |
|
Back to top |
|
|
rick
New User
Joined: 18 Jun 2004 Posts: 59 Location: Chennai
|
|
|
|
Hi,
You could do it with PICIN and PICOUT Clause. But be careful in usage of these two clause when handling decimal points.
Say you want to accept 12345.67 as your input. Your coding should be like this
Code: |
DFHMDF POS=(10,10),LENGTH=8,PICIN='9(5)V9(3)',PICOUT='9(5).9(2)'
|
if u are trying to give the same value in both PICIN and PICOUT it might give an error. Becoz
9(5)v9(3) takes 8 bytes and
9(5).9(3) takes 9 bytes.
Try it, |
|
Back to top |
|
|
sarma Kappagantu
New User
Joined: 17 Mar 2005 Posts: 22 Location: Bangalore
|
|
|
|
This picout of 9(nn).9(mm) works fine with output. How about input? It is better to use, two separate variables one of the integer part and the other for decimal part. All problems solved. |
|
Back to top |
|
|
vmj
New User
Joined: 16 May 2006 Posts: 16 Location: Philippines
|
|
|
|
rick wrote: |
Hi,
You could do it with PICIN and PICOUT Clause. But be careful in usage of these two clause when handling decimal points.
Say you want to accept 12345.67 as your input. Your coding should be like this
Code: |
DFHMDF POS=(10,10),LENGTH=8,PICIN='9(5)V9(3)',PICOUT='9(5).9(2)'
|
if u are trying to give the same value in both PICIN and PICOUT it might give an error. Becoz
9(5)v9(3) takes 8 bytes and
9(5).9(3) takes 9 bytes.
Try it, |
Hi rick,
hope you can still help me here. Same with sarma, we have no problem here with PICOUT.
We input a numerical value with decimals into a field (let's name it x) define in the map as PICIN='9(15)v9(3)',PICOUT='9(15).9(2).
we need to process x and we discover that x still contains the decimal points/period, and with that we are unable to do arithmetic operation with field x.
we will appreciate any explanations/help/suggestions/comments from anyone.
thanks for reading.... |
|
Back to top |
|
|
gm_laks
New User
Joined: 10 Jul 2007 Posts: 7 Location: banagalore
|
|
|
|
i have a suggestion to do it programtically.
define the following variables
num-1.
num-1-bef pic 9(15).
filler pic x(01).
num2-aft pic 9(2).
num-2.
num2-bef pic 9(15).
num2-aft pic 9(2).
number-2 redefines num-2 pic 9(15)v9(2).
move x to num-1
move num-1-bef to num2-bef
move num-1-aft to num2-aft.
now you can use the variable number-2 for all arithmetic purposes. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
It is a heck of a lot easier to use FUNCTION NUMVAL to de-edit the field.
For what it's worth, if the PICIN is X(nn), it can be moved directly to a S9(nn)v9(n) field with correct sign, decimal alignment and padding (according to the section on Elementary moves in the explanation of the MOVE statement in the Procedure Division statements chapter in the Enterprise COBOL for z/OS and OS/390 Language Reference. |
|
Back to top |
|
|
|