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

unable to read the the negative sign to db2 table


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

New User


Joined: 14 Sep 2005
Posts: 54
Location: Chennai

PostPosted: Mon Jun 23, 2008 10:07 pm
Reply with quote

Hi All,

I have one file with some data in it.
i need to store the data into one DB2 table.

Input file declared as following
10 DLR-SALES-BAL PIC S9(8)V9(2).
10 DLR-SERVICE-BAL PIC S9(8)V9(2).
10 CORP-SALES-BAL PIC S9(8)V9(2).
10 CORP-SERVICE-BAL PIC S9(8)V9(2).

Db2 table copybook layout
DB2 Table variables:
FCUO09_DLR_SLS_A DECIMAL(10, 2) NOT NULL,
FCUO09_DLR_SRV_A DECIMAL(10, 2) NOT NULL,
FCUO09_CORP_SLS_A DECIMAL(10, 2) NOT NULL,
FCUO09_CORP_SRV_A DECIMAL(10, 2) NOT NULL,

Host Lang variables
10 DLR-SLS-A PIC S9(8)V9(2) USAGE COMP-3.
10 DLR-SRV-A PIC S9(8)V9(2) USAGE COMP-3.
10 CORP-SLS-A PIC S9(8)V9(2) USAGE COMP-3.
10 CORP-SRV-A PIC S9(8)V9(2) USAGE COMP-3.

When am trying to MOVE the negative values to DB2 variables negative sign is missing.
can any one please explain why it is missing and how to get the -ve sign in the table records??

MOVE statement:
MOVE DLR-SALES-BAL TO DLR_SLS_A
MOVE DLR-SERVICE-BAL TO DLR_SRV_A
MOVE CORP-SALES-BAL TO CORP_SLS_A
MOVE CORP-SERVICE-BAL TO CORP_SRV_A

I used DISPLAY statement in to check the values
In SYSOUT it is showing as following.

INPUT FILE
0000000000
-000000242
0000000000
0000000000
COPY BOOK
0000000000
0000000242
0000000000
0000000000
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jun 23, 2008 10:16 pm
Reply with quote

Your data in the input file and the data descriptions don't match.
For -000000242 the data description should be DLR-SALES-BAL PIC S9(8)V9(2) SIGN IS LEADING SEPARATE 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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top