Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am
No new posts Adding a userid to SMTP Security table Yolanda Harvey JCL & VSAM 1 Sun Aug 13, 2017 6:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us