Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Feb 09, 2004 11:44 am Post subject:
Somu,
You still did not answer my first question , is the decimal point variable?.i.e
Code:
----+----1----+----2----+----3----+----4----+----5----+---
1 20000.00 <== DECIMAL STARTS AT 13
2 400.00 <== DECIMAL STARTS AT 11
3 5000000.00 <== DECIMAL STARTS AT 15
4 1000.00 <== DECIMAL STARTS AT 12
now if you see the above data the decimal is variable. Is it always as shown above? The declaration shows that you have 3 decimal digits but your sample data only shows 2 digits. can you clarify that?
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Feb 09, 2004 1:06 pm Post subject:
Somu,
The following DFSORT/ICETOOL JCL will give you the desired results. If you have syncsort at your shop then change the pgm name to synctool. A brief explanation of the job. I assumed that your input file is 80 bytes of length and is FB recfm.Also I assumed that you amount field starts at pos 5 with the following declaration 9(09)v9(2).
Since the decimal is a variable we need to split the records into different file depending upon the decimal position.using Inrec we add a seqnum at the end of each record , so that w can retain orginal sequence of the data.
The first copy operation splits the input record into different file depending on the position of the decimal.Using outrec we edit mask the amount field.
The second sort step takes all these temp files together and sorts on the seqnum , so that we retain the orginal sequence. we also strip off the seqnum while writting the final output.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Dec 27, 2004 12:54 pm Post subject:
With z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004), you can use DFSORT's new UFF format and IFTHEN and OVERLAY functions to do this more easily and efficiently with only one copy pass using a single INREC statement as follows:
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed May 17, 2006 2:13 pm Post subject:
With z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006), you can use DFSORT's new JFY function to do this even more easily and efficiently with only one copy pass using a single INREC statement as follows:
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