Posted: Wed Jun 23, 2004 9:16 am Post subject: DFSORT - Select on date ??
Hi Gurus
Is this possible via DFSORT? I think not...
1. Select records only when you find today's (or yesterdays or 10 days before) date on the file in the specified colums (here from col num. 8 to length 8 ). I am not supplying the date seperately to the job(via file etc.).
2.
In the above code it should output a file containg the missing sequence numbers (cols 1. to length 6 ). The range should be picked up from the first record and the last record. It is sorted in ascending order.
I will not be supplying the range seperately.
This is not difficult to program but I am curious if DFSort can do this using some operators...
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Jun 23, 2004 11:24 am Post subject:
Kolusu wrote to Coolman
Quote:
well may be I will give up posting in the sort forum and you can try posting to the solutions.
Well, I have been known to post a solution occasionally when you don't beat me to it. (But it does save me a lot of time when you post the solution and, of course, I only post solutions to DFSORT questions.) _________________ 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
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Jun 23, 2004 1:48 pm Post subject:
Relaxing,
The following DFSORT/ICETOOL JCL will give you all the missing records within the given range. You need to have DFSORT PTF UQ90053(Repeat Parm) installed for this job to work. A brief explanation of the job.
The first copy operator creates 2 files. File S1 will just have the account number.
File T1 will contain the MAX value of Seqnum and MIN Value of the seqnum.
Now we take this file with MAX and MIN file and generate a dynamic control card, so that it we generate all the seqnum between the min and max seqnum. For that we use the Repeat parm.
First we subtract the MIN from the MAX and add 1 to the difference. Now we generate dynamic control cards as follows
Now using a dummy record file we create all the seqnum in the range.
Once we have all the seq numbers in the range , we then concatenate the S1 & S2 file together and select all the unique seq numbers using the parm NODUPS.
PS: I would like to thank Frank for testing this solution as my shop had syncsort which does not support the REPEAT parm. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Wed Jun 23, 2004 2:07 pm Post subject:
Relaxing,
The following JCL will give you yesterday's records from the input file. A brief explanation of the job. We generate a dynamic control card using DB2 Unload. We dynamically generate a control card like this
Code:
INCLUDE COND=(8,8,ZD,EQ,20040622)
Now using the dynamic control card we pick only the records which match yesterday's date.
If you want records for the last 10 days then change the sysin parm in step0100 to the following.
Code:
SELECT CHAR(' INCLUDE COND=(8,8,ZD,EQ,')
,SUBSTR(CHAR(CURRENT DATE - 10 DAYS),1,4)
,SUBSTR(CHAR(CURRENT DATE - 10 DAYS),6,2)
,SUBSTR(CHAR(CURRENT DATE - 10 DAYS),9,2)
,CHAR(') ')
FROM SYSIBM.SYSDUMMY1
;
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu May 18, 2006 3:29 pm Post subject:
With z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 April, 2006), you can now use:
Code:
INCLUDE COND=(8,8,ZD,EQ,DATE1P-1)
to only include the records with yesterday's date. For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTFs, see:
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