Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Sep 21, 2004 4:13 pm Post subject:
What are the exact "rules" for which records to extract? From your brief example, one could guess the last 2 records, or the 5th and 6th records, or the records with "21" and "z" or ...? You have to give us more to go on. _________________ 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: 02 Dec 2002 Posts: 48 Topics: 9 Location: Columbus, GA
Posted: Tue Sep 21, 2004 5:28 pm Post subject:
Frank,
Sorry for not providing enough information.
Daily, this particular file will be updated by other application and the log records will be written after the today's date.
x,y,z -> can have any value
I need to extract the records starting from the todays date (Sep 21 2004)given ( today's date can be given as the input in the control card). i.e., I need only today's log records in the output
If date is available in all the records, then it will be easy to extract the records. But date will be available only at the initial record.
Let me know if you need more information _________________ Thanks,
Jeba
(Known is a drop Unknown is an ocean)
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Sep 21, 2004 6:53 pm Post subject:
Jeba,
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Get date as yyyymmdd
INREC FIELDS=(DATE1)
* Get Symbol for date as:
* Curdate,'mon dd yyyy'
OUTREC FIELDS=(C'Curdate,''',
5,2,CHANGE=(3,
C'01',C'Jan',C'02',C'Feb',C'03',C'Mar',C'04',C'Apr',
C'05',C'May',C'06',C'Jun',C'07',C'Jul',C'08',C'Aug',
C'09',C'Sep',C'10',C'Oct',C'11',C'Nov',C'12',C'Dec'),X,
7,2,X,1,4,C'''',80:X)
/*
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//IN DD DSN=... input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CTL3CNTL DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
* IN->T1: Add SEQNUM to IN records.
COPY FROM(IN) TO(T1) USING(CTL1)
* T1->CTL3CNTL: Generate:
* OPTION COPY,SKIPREC=n
* where n is seqnum-1 of Curdate record.
COPY FROM(T1) TO(CTL3CNTL) USING(CTL2)
* IN->OUT: Use OPTION COPY,SKIPREC=n
* to get record with current date and
* subsequent records.
COPY FROM(IN) TO(OUT) USING(CTL3)
/*
//CTL1CNTL DD *
INREC FIELDS=(1,80,81:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
INCLUDE COND=(1,11,CH,EQ,Curdate)
OPTION STOPAFT=1
OUTREC FIELDS=(C' OPTION COPY,SKIPREC=',
81,8,ZD,SUB,+1,TO=ZD,LENGTH=8,80:X)
/*
_________________ 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
Last edited by Frank Yaeger on Wed Sep 22, 2004 9:25 am; edited 1 time in total
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Wed Sep 22, 2004 8:43 am Post subject:
Frank,
I guess you forgot to change the //SORTIN DD input file. &&IN was the input data set used for your test. If the date occurs only once in the file then do we really need 3 passes of data? I can think we can club CTL1 & CTL2 control cards into 1 single control card.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Sep 22, 2004 9:30 am Post subject:
Kolusu,
Yes, I forgot to change the //SORTIN DD. I've fixed it.
Yes, if there's only one date that matches the current date, then we could do it in one less pass. And using START=0 to get seqnum-1 for SKIPREC is a good idea. _________________ 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: 02 Dec 2002 Posts: 48 Topics: 9 Location: Columbus, GA
Posted: Wed Sep 22, 2004 2:38 pm Post subject:
Frank/ Kolusu,
Great!!!!
Thanks for the solution. It is working good. I have used CTL1CNTL from Kolusu's reply and removed the CTL3CNTL since the input record will have only one date that matches the current date. _________________ Thanks,
Jeba
(Known is a drop Unknown is an ocean)
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