convert Value to S9(9) COMP-3



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

convert Value to S9(9) COMP-3

Postby rjambu » Thu Mar 10, 2011 2:49 am

I need to convert the 3rd column of the file to S9(9) COMP-3

Input file that comes from diff source is like :
--------------------------
000056-2¦111¦2.000 ¦PA¦
000012-2¦222¦0.000 ¦OH¦
001293-1¦333¦10.000 ¦CT¦
001393-1¦444¦1224.000 ¦AZ¦



The issue is when i view the output file (Hex mode) it is having 000 to its value
this is same when i use the file to load a table

Eg.
2.000 is converted to 2000
10.000 is converted to 10000
1224.000 is converted to 1224000

is there a way to eliminate the 3 zeros

Below is the JCL, i use to conver the packed decimal

//STEP010 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD  DSN=A.B.SRC1
//SORTOUT  DD DSN=A.B.TGT1,
// UNIT=DISK,SPACE=(TRK,(1,2),RLSE),
// DCB=(LRECL=16,BLKSIZE=0,RECFM=FB),
// DISP=(NEW,CATLG,DELETE)
//SYSSORT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//*
//SYSIN DD *
SORT FIELDS=COPY
INREC PARSE=(%00=(ENDBEFR=X'6A',FIXLEN=06),
             %01=(ENDBEFR=X'6A',FIXLEN=03),
             %02=(ENDBEFR=X'6A',FIXLEN=10),
             %03=(ENDBEFR=X'6A',FIXLEN=02)),
BUILD=(%00,%01,%02,UFF,PD,LENGTH=5,%02)
/*
//


Thanks
JRS
rjambu
 
Posts: 27
Joined: Tue Feb 08, 2011 7:59 pm
Has thanked: 0 time
Been thanked: 0 time

Re: convert Value to S9(9) COMP-3

 

Re: convert Value to S9(9) COMP-3

Postby Frank Yaeger » Thu Mar 10, 2011 4:27 am

PD format does NOT store the decimal point internally. A PD value of 2000 is stored internally as X'02000C'. A PD value of 2.000 is also stored internally as X'02000C'. The PD value itself has NO INDICATION of a decimal point. You figure that out when you represent the value externally.
Given that, your question about eliminating the 3 zeros makes no sense so you need to clarify exactly what you're trying to do.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post