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
 

 

unable to read the the negative sign to db2 table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: unable to read the the negative sign to db2 table
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Read of TDQ fails in LENGERR Tracy Hansen CICS 10 Wed Apr 05, 2017 12:10 am


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