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
 

 

moving values from CICS screen to database
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
hills

New User


Joined: 27 Apr 2009
Posts: 8
Location: Bangalore

PostPosted: Mon May 04, 2009 4:00 pm    Post subject: moving values from CICS screen to database
Reply with quote

In CICS screen I am giving the values as below:-

PLAN NAME vod298
LOCAL CALL RATE 12354
LONG DISTANCE CALL RATE 56879
ISD CALL RATE 45143
MONTHLY RENTAL 215
ROAMING CHARGES 45645
LCL SMS CHARGE 31321
STD SMS CHARGES 23154
ISD SMS CHARGES 65487
FREE CALLS 641
FREE SMS 131

Now I am inserting this values into the database...
When I am checking the database, I am getting the values as below:-

TBS_PLAN_NAME VOD298
TBS_LCALL_RATE 354.00
TBS_SDCALL_RATE 879.00
TBS_ICALL_RATE 143.00
TBS_LSMS_RATE 321.00
TBS_LDSMS_RATE 154.00
TBS_ISMS_RATE 487.00
TBS_RMNG_RATE 645.00
TBS_MNTH_RENTAL 215
TBS_FREE_SMS 131
TBS_FREE_CALLS 641
The problem is that if I am giving value as 12354 it is taking as 354.00
In creating table, I am using the DEC(5,2).

I am not able to understand the reason behind this.

Please give the solution what to do????
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 04, 2009 4:13 pm    Post subject:
Reply with quote

what is the definition of your host variables?
Back to top
View user's profile Send private message
hills

New User


Joined: 27 Apr 2009
Posts: 8
Location: Bangalore

PostPosted: Mon May 04, 2009 4:23 pm    Post subject:
Reply with quote

I am not using any host variables.

Directly moving values from CICS to database.
Back to top
View user's profile Send private message
hills

New User


Joined: 27 Apr 2009
Posts: 8
Location: Bangalore

PostPosted: Mon May 04, 2009 4:39 pm    Post subject:
Reply with quote

I tried using the host variables and gave their definition as
PIC 9(3).9(2).

Showing the same values.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 04, 2009 4:40 pm    Post subject:
Reply with quote

hills wrote:
I am not using any host variables.

Directly moving values from CICS to database.


sigh**,

do you mean you are using the map definitions?


show us your sql.
Back to top
View user's profile Send private message
hills

New User


Joined: 27 Apr 2009
Posts: 8
Location: Bangalore

PostPosted: Mon May 04, 2009 4:52 pm    Post subject:
Reply with quote

Quote:
I tried using the host variables and gave their definition as
PIC 9(3).9(2).

Showing the same values.



The sql code is as under:

Code:
EXEC SQL
         INSERT INTO TBSPLTR (TBS_PLAN_NAME,
                              TBS_LCALL_RATE,
                              TBS_SDCALL_RATE,
                              TBS_ICALL_RATE,
                              TBS_MNTH_RENTAL,
                              TBS_RMNG_RATE,
                              TBS_LSMS_RATE,
                              TBS_LDSMS_RATE,
                              TBS_ISMS_RATE,
                              TBS_FREE_CALLS,
                              TBS_FREE_SMS)
                      VALUES (:TBS-PLAN-NAME,
                              :TBS-LCALL-RATE,
                              :TBS-SDCALL-RATE,
                              :TBS-ICALL-RATE,
                              :TBS-MNTH-RENTAL,
                              :TBS-RMNG-RATE,
                              :TBS-LSMS-RATE,
                              :TBS-LDSMS-RATE,
                              :TBS-ISMS-RATE,
                              :TBS-FREE-CALLS,
                              :TBS-FREE-SMS)
END-EXEC.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 04, 2009 4:54 pm    Post subject:
Reply with quote

try using 9(3)V9(2)
instead of 9(3).9(2)
Back to top
View user's profile Send private message
hills

New User


Joined: 27 Apr 2009
Posts: 8
Location: Bangalore

PostPosted: Mon May 04, 2009 7:41 pm    Post subject:
Reply with quote

I tried using 9(3)V9(2), but the same error.

Below is the display giving CEDF on and then running:-

Code:
EXEC SQL INSERT
   DBRM=TBSPLAN2, STMT=00218, SECT=00001
   IVAR 001: TYPE=CHAR,                 LEN=00006,    IND=000     AT X'2C12A0E0'
             DATA=X'E5D6C4F5F8F7'
   IVAR 002: TYPE=DECIMAL,              LEN=05.02,    IND=000     AT X'2C12A0E6'
             DATA=X'61300C'
   IVAR 003: TYPE=DECIMAL,              LEN=05.02,    IND=000     AT X'2C12A0E9'
             DATA=X'78900C'
   IVAR 004: TYPE=DECIMAL,              LEN=05.02,    IND=000     AT X'2C12A0EC'
             DATA=X'15300C'
   IVAR 005: TYPE=INTEGER,              LEN=00004,    IND=000     AT X'2C12A0FB'
               OFFSET:X'0012B0'    LINE:UNKNOWN        EIBFN=X'1802'



The values here I had given was
1) 45613
2) 15789
3) 64153

It is taking the last 3 digits and then puts zeroes.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon May 04, 2009 7:48 pm    Post subject:
Reply with quote

OK, the definition is (5,2) and your value is 45613. Let's see ... there is no decimal point in 45613 so the implied decimal point will be after the 3 (absent anything to change that) ... so now we have 45613.00 based on the data definition ... oops, too many characters before the decimal point so let's chop it down and now we have 613.00
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon May 04, 2009 7:52 pm    Post subject:
Reply with quote

ok,


you are losing positions because your decimal alignment is not correct
either because of PIC definition
or your manipulation of the data.

for one field/column for which you are having trouble, please provide
  • the screen input field definition
  • the host variable definition
  • the column defintion


with that info we can provide you some guidance.
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Tue May 05, 2009 3:40 am    Post subject:
Reply with quote

DEC(5,2). this statement set up for 5 places and 2 of them are the
decimal position. 12345 work then be 123.45. the first postion is the length of the field and the next is the implied decimal.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue May 05, 2009 3:44 am    Post subject:
Reply with quote

But it depends on what is moving the data; 12345 may be treated as 123.45 or as 345.00 depending. It appears the O/P was expecting the first case and got the second case. Without more details, such as the language being used to interact with the CICS map, that's about all we can say. Both move forms are valid and occur for different languages and variable definitions.
Back to top
View user's profile Send private message
Vishu

New User


Joined: 23 Mar 2009
Posts: 22
Location: Bangalore

PostPosted: Tue May 05, 2009 11:38 am    Post subject:
Reply with quote

Even I tried a similar move from CICS screen to the Table sometimes back. It went as under:
1. BMS: the attribute was set as (UNPROT,NUM).
2. Table: Datatype was decimal(7,2) not null .
3. COBOL-CICS-DB2 program:
data was accepted from the screen and directly moved to table as:

Code:
MOVE  ADJAM3I              TO    TBS-ADJ-AMT


SQL is the same as the one provided by HILLS

The Transaction works as under:

When 2 in entered - the table gets 00000.02
When 22222 in entered - the table gets 00222.22


( I would suggest rather than moving data from MAP Inputs to WS-variables and then to the TABLE, we can directly move it to the TABLE)
Back to top
View user's profile Send private message
aishwarya_20

New User


Joined: 19 Nov 2008
Posts: 57
Location: pune

PostPosted: Tue May 05, 2009 1:24 pm    Post subject:
Reply with quote

When you are receiving data from CICS screen then what is the defination of ADJAM3I in the map i.e. what Picture clause is there?
Back to top
View user's profile Send private message
Vishu

New User


Joined: 23 Mar 2009
Posts: 22
Location: Bangalore

PostPosted: Tue May 05, 2009 1:56 pm    Post subject:
Reply with quote

Quote:
When you are receiving data from CICS screen then what is the defination of ADJAM3I in the map i.e. what Picture clause is there?


Code is as under:
Code:

ADJAM3  DFHMDF POS=(10,28),ATTRB=(FSET,UNPROT,NUM),COLOR=NEUTRAL,      X
               HILIGHT=UNDERLINE,LENGTH=7
Back to top
View user's profile Send private message
aishwarya_20

New User


Joined: 19 Nov 2008
Posts: 57
Location: pune

PostPosted: Tue May 05, 2009 1:58 pm    Post subject:
Reply with quote

It means if you declare hot variable as x(5) then it will be as per your expectation.
Back to top
View user's profile Send private message
Vishu

New User


Joined: 23 Mar 2009
Posts: 22
Location: Bangalore

PostPosted: Tue May 05, 2009 2:19 pm    Post subject:
Reply with quote

Quote:
It means if you declare hot variable as x(5) then it will be as per your expectation.


Yes, we can say it is equivalent to x(7) .
( sorry to correct you but LENGTH=7 not =5) icon_smile.gif
Back to top
View user's profile Send private message
aishwarya_20

New User


Joined: 19 Nov 2008
Posts: 57
Location: pune

PostPosted: Tue May 05, 2009 2:22 pm    Post subject:
Reply with quote

I metioned length as 5 which is pointing to your problem. In your problem you were having DEC(5,2). So in your program you can move data to PIX X(5). It should give correct result.
Back to top
View user's profile Send private message
Vishu

New User


Joined: 23 Mar 2009
Posts: 22
Location: Bangalore

PostPosted: Tue May 05, 2009 2:35 pm    Post subject:
Reply with quote

Quote:
I metioned length as 5 which is pointing to your problem. In your problem you were having DEC(5,2). So in your program you can move data to PIX X(5). It should give correct result.


This will be helpfull to HILLS ( The creater of this topic).

My code is different and has DECIMAL(7,2). It is working fine.
I posted my code to show how it could be done.
Back to top
View user's profile Send private message
hills

New User


Joined: 27 Apr 2009
Posts: 8
Location: Bangalore

PostPosted: Wed May 06, 2009 11:50 am    Post subject:
Reply with quote

Hi all,

Thanks,

But the problem is still not solved...
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 -> DB2 All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
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 IMS DC screen Access sivasaras IMS DB/DC 3 Fri Nov 18, 2016 6:38 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts IMS Database backup info ashek15 IMS DB/DC 14 Wed Nov 16, 2016 5:29 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am


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