Dear all,
I am trying a send a text file from java application to Mainframe to upload into DB2.here the problem is when i use load utilities i am not able to convert the decimal(java short datatype) to DB2 format which is S9(4) comp-4 or binary.similarly float datatype to packed decimal(S9(9)V99 COMP -1)
i also understand there should be cobol/easytrive to load the file that is generated from Java.our manager doesnt want a cobol program to be written. so i am just looking for DFSORT.. is there any way that i can convert the decimal and float data into cobol computational data such as s9(9) comp-4 in JCL?
i also tried to write a java program that converts the equivalent of s9(9) comp-4 data.. since the representation is different i culd not go for that option too?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
vijayalayancse,
Quote:
similarly float datatype to packed decimal(S9(9)V99 COMP -1)
You say packed decimal and COMP-1. Did you mean COMP-3? With DFSORT you can easily convert the numbers into COMP/COMP-4 and COMP-3
Just convert the java data types to regular readable numbers with signs(+10 or -10.99) and you can run a sort step step to convert them back to the DB2 format.
Can you explain me what is there in the SORT IN dd ?
(like -100, +10 and the equivalent numbers ). your explanation would be helpful for my SORT utility JCL..
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
vijayalayancse,
You are converting one filed to Packed decimal and another to zoned decimal format. What are the corresponding DB2 table definitions? ZD format is nothing but a character representation of numeric data.
Show me the DB2 table table definitions for these 2 columns and also show me the contents from 369 thru 382 in your input file and I will show you the control cards necessary for converting them
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
vijayalayancse,
I see the problem now since your input doesn't have the leading zeros the values are stroed as if they are just decimals. Use the following control cards
Thanks for ur reply.
The output should be same as the input. as i am sending the files from java i just need to upload them into DB2 without any modification.
20.0000
0.0013 ===> should have been 0.13
2.0000
8.0000
2.0000
8.0000
4.0000
1.0008 === > should have been 1.8
1.0003 === > should have been 1.3
0.0075 == should have been 0.75
if you could help me out in this.. i would appreciate it