data type conversion



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

data type conversion

Postby sunwillow » Fri Jun 11, 2010 10:44 am

hello
i have a question.
I unload a dataset from a table. there was a filed which was defined in DEC(15,2), So i must use the HEX parm in the dataset to see it.
....カ.&.
00016350
0001650D


I want to convert the filed to FS, but the conversion result was -116635500,
but if i query it in the table, the result is -1166355.00
how can i convert it that make it the same as the tale?

convertion parm
//SYSIN    DD *                     
 OPTION COPY                       
 INREC  FIELDS=(65,8,PD,TO=FS)
sunwillow
 
Posts: 3
Joined: Thu May 20, 2010 8:42 am
Has thanked: 0 time
Been thanked: 0 time

Re: data type conversion

Postby skolusu » Fri Jun 11, 2010 10:21 pm

sunwillow,

DB2 DECIMAL (15,2) = COBOL PIC S9(13)V9(2) COMP-3. = 8 BYTES of storage

You need to use edit mask to retain the decimal value. Use the following control cards. The positive numbers will have a space for sign and negative numbers will have - as sign.

//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
  INREC FIELDS=(65,8,PD,EDIT=(SIIIIIIIIIIIIT.TT),SIGNS=(,-))
//*


If you the + sign for positive numbers then change the signs statement to
SIGNS=(+,-)
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: data type conversion

Postby sunwillow » Mon Jun 14, 2010 3:23 pm

skolusu,
I got it, thank you very much.
sunwillow
 
Posts: 3
Joined: Thu May 20, 2010 8:42 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post