Joined: 19 Jan 2003 Posts: 6 Topics: 3 Location: India
Posted: Thu Feb 06, 2003 3:11 am Post subject: to copy comp-3 value to output file and store as numeric
Hi,
I have a input file at 10th position variable x is defined at pic s9(3) comp-3. As the value will be stored in 2 bytes, my requirement is to copy this value to a output file at position 4 and store this value as numeric 3 bytes and in the output file the variable is defined as pic s9(3).
I am using syncsort and here is what I am giving
INREC Fields=(4:10,2,pd,zd)
But I am not getting proper value in the output file. As I assumed from the above syntax
From the inputfile at 10th position take the 2byte value which is comp-3 and put it in the output file at 4th position as zonal decimal.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Feb 06, 2003 11:45 am Post subject:
Ravi,
With DFSORT, your INREC statement will give you what you want because for PD to ZD conversion, DFSORT uses a F sign for the last digit which makes it printable (e.g. X'123C' -> X'F1F2F3' -> C'123'). But I believe Syncsort uses a C sign for the last digit which makes it unprintable (e.g. X'123C' -> X'F1F2C3' -> -> C'12C'). Is that what you're seeing?
Assuming your PD values are all positive, this will give you the equivalent of printable positive ZD values:
Code:
INREC FIELDS=(4:10,2,PD,M11)
M11 is a mask for T...T where T is a digit with leading zeros printed.
If you do have negative numbers, then you can't get printable ZD values because the sign for ZD is D (e.g. X'123D' -> X'F1F2D3' -> C'12L'), so you'd have to figure out what you really want the output to look like. Kolusu's example with EDIT=(STTT) and SIGNS is one possibility. For DFSORT, the M26 edit mask will give you the same thing, but I don't think Syncsort supports M26. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum