Posted: Fri Apr 15, 2005 1:30 pm Post subject: SORT-: Convert a field from usage display to Comp-3
My input file looks like this.
Code:
----+----1----+----2----+----3----+----4----+----5----
********************************* Top of Data ********
HALLAHALLMARK ORIG FEE VOL+0000000000000.00+0.001850
CDW ACDW ORIG FEES OEC+0000000000000.00+0.002500
CHDNMTOSH CHILD HOSP RES OEC+0000000000000.00+0.002500
APRPAAPPLE RATE PAR VOL+0000000000000.00+0.002500
CHNLACHANNEL TOP LIST VOL+0000000000000.00+0.002500
IBMOAIBM OUT ORIG FEES VOL+0000000000000.00+0.002500
What matters to me is AMT starting position 29 and PCT starting position 46. I need to get these fields converted into
AMT PIC S9(13)V99. (Amount will not be comp-3)
PCT PIC S9V9(6) COMP-3. for a database load job.
Could you please tell me a SORT solution for this ? _________________ Regards,
Shivprakash
Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Fri Apr 15, 2005 2:00 pm Post subject:
Shiv_swami,
Try this
Code:
//SYSIN DD *
SORT FIELDS=COPY
INREC FIELDS=(01,28, $ FIRST 28 BYTES
29,14, $ AMT PORTION BEFORE DECIMAL
44,2, $ DEC PORTION IN AMT
46,2, $ PCT PORTION BEFORE DECIMAL
49,6) $ DEC PORTION IN PCT
OUTREC FIELDS=(1,28,
29,16,FS,PD,LENGTH=8,
45,8,FS,PD,LENGTH=4)
/*
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Apr 15, 2005 3:26 pm Post subject:
Quote:
AMT PIC S9(13)V99. (Amount will not be comp-3)
PCT PIC S9V9(6) COMP-3. for a database load job.
So the AMT value should be a 15-byte ZD value and the PCT value should be 4-byte PD value.
With z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004), you can use DFSORT's new SFF (signed free form) format to do this quite easily. If you have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free).
Here's the DFSORT job. It wasn't clear where you wanted the converted values in the output record or what length you wanted for the output records, but the job can be changed appropriately depending on what you want.
_________________ 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
Frank,
We do not have DFSORT at our installation. (Neither do I have influence over the procedure of product selection.) So I cannot use DFSORT solution. _________________ Regards,
Shivprakash
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