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

Retreiving Decimal Values From BMS map


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

New User


Joined: 12 Mar 2005
Posts: 1

PostPosted: Thu Mar 17, 2005 11:19 am
Reply with quote

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
View user's profile Send private message
rick

New User


Joined: 18 Jun 2004
Posts: 59
Location: Chennai

PostPosted: Thu Mar 17, 2005 6:13 pm
Reply with quote

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
View user's profile Send private message
sarma Kappagantu

New User


Joined: 17 Mar 2005
Posts: 22
Location: Bangalore

PostPosted: Mon Mar 21, 2005 11:47 am
Reply with quote

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
View user's profile Send private message
vmj

New User


Joined: 16 May 2006
Posts: 16
Location: Philippines

PostPosted: Mon May 07, 2007 3:05 pm
Reply with quote

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
View user's profile Send private message
gm_laks

New User


Joined: 10 Jul 2007
Posts: 7
Location: banagalore

PostPosted: Tue Jul 10, 2007 11:46 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jul 11, 2007 12:08 am
Reply with quote

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
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
Search our Forums:

Back to Top