Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Mar 30, 2005 4:52 pm Post subject:
It's not clear what you're trying to do. All I see from your example is that you removed the header/detail records for RPT2 and RPT4. Are you trying to remove the second, fourth, sixth, etc report lines, or are you trying to do something else?
Please be more clear about what you want. Also, what is the RECFM and LRECL of your input file? _________________ 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: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Wed Mar 30, 2005 5:09 pm Post subject:
Frank,
Thanks for your quick response. All I'm trying is filter out only specific sections of the report. In this example, I want RPT1 header followed by its detail records until the next report header. Then RPT3 followed by its detail records until the next and so on. I know upfront what are the different header that I want. Here in this example, its RPT1, RPT3 and RPT5.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Mar 30, 2005 7:44 pm Post subject:
Coolman,
Do you want to "filter out" the sections by hardcoding the report header id (e.g. 'RPT.012', 'RPT.023', etc) as an INCLUDE condition or some other way? _________________ 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: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Thu Mar 31, 2005 9:24 am Post subject:
Frank,
Okay. It appear that I'm not clear. I have a report which has a bunch of report id's which vary from 1 to 100. Now, there are times, when I would have to filter only some specific report id's such as RPT.012, RPT.023 as in this example. I do not want to hardcode these values as the header containing these report id's may have different headings. So, I would need those header records(which contains the report id) followed by the list of details records until I hit another report id. Now, if the subsequent report id matches my criteria, I would be writing those to the output else I would have to skip and this processing needs to be done until the end of the file.
Hope I have made it clear this time
________
one vaporizer
Last edited by coolman on Sat Feb 05, 2011 1:41 am; edited 1 time in total
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Mar 31, 2005 12:17 pm Post subject:
What identifies a report id (that is, the first record of a report section)? Does it have 'RPT' as the first three characters or something else? If there's nothing that identifies a report id, then how do we know where a report section starts?
You say you don't want to hardcode these values (the report ids), but you don't say how you want to input the values to the job. For example, if you want the reports for ids 'RPT.012' and 'RPT.023', how are you going to communicate that to the job? I suggested INCLUDE because you could put whatever report ids you need for that particular run into the INCLUDE statement. Alternatively, you could set the report ids up as DFSORT symbols and use those symbols in the INCLUDE statement. Or do you have another way of communicating the report ids you want to the job that you haven't made clear yet? Like just the number of the report (e.g. 12, 23), and again how are you going to communicate that to the job?
Quote:
Now, if the subsequent report id matches my criteria, I would be writing those to the output else I would have to skip and this processing needs to be done until the end of the file.
To belabor the point, how are you specifying the "criteria"?
I hope I'm explaining what's missing clearly. _________________ 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: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
Posted: Thu Mar 31, 2005 1:52 pm Post subject:
Frank,
Your assumption is right. I would know the report id's when the job is executed (which is the criteria) such as RPT.012, RPT.023. Please let me know if you need any more information.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Mar 31, 2005 3:57 pm Post subject:
Coolman,
Below is a DFSORT/ICETOOL job that will do what I think you want. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) to use the new DFSORT/ICETOOL IFTHEN, OVERLAY and KEEPBASE functions.
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
RPT.001
LINE 01
LINE 02
LINE 03
RPT.002
LINE 04
LINE 05
LINE 06
LINE 07
RPT.003
LINE 08
LINE 09
RPT.004
LINE 10
LINE 11
LINE 12
RPT.005
LINE 13
LINE 14
LINE 15
LINE 16
RPT.006
LINE 17
LINE 18
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file
//TOOLIN DD *
* Reformat records by group as follows:
* RPT.id1 |RPT.id1|00000001|blanks |
* detail |blanks |00000001|tempnum|
* detail |blanks |00000001|tempnum|
* ...
* RPT.id2 |RPT.id2|00000002|blanks |
* detail |blanks |00000002|tempnum|
* detail |blanks |00000002|tempnum|
* ...
COPY FROM(IN) TO(T1) USING(CTL1)
* Use the group number to splice 'RPT.idn' from
* each header into its detail records as follows:
* RPT.id1 |RPT.id1|00000001|blanks |
* detail |RPT.id1|00000001|tempnum|
* detail |RPT.id1|00000001|tempnum|
* ...
* RPT.id2 |RPT.id2|00000002|blanks |
* detail |RPT.id2|00000002|tempnum|
* detail |RPT.id2|00000002|tempnum|
* ...
* Then do an INCLUDE using RPT.idn for the groups you want.
SPLICE FROM(T1) TO(OUT) ON(88,8,ZD) -
WITHALL WITH(1,80) KEEPBASE USING(CTL2)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(88:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,4,CH,EQ,C'RPT.'),
OVERLAY=(81:1,7,88:SEQNUM,8,ZD)),
IFTHEN=(WHEN=NONE,
OVERLAY=(96:SEQNUM,8,ZD,
88:88,8,ZD,SUB,96,8,ZD,M11,LENGTH=8))
/*
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,
* Use an INCLUDE with 81,7,CH,EQ,C'RPT.idn' for the
* groups you want.
INCLUDE=(81,7,CH,EQ,C'RPT.002',OR,
81,7,CH,EQ,C'RPT.004',OR,
81,7,CH,EQ,C'RPT.005'),
* Remove the copy of the report id, the group number
* and the temp number.
BUILD=(1,80)
/*
The INCLUDE selects groups RPT.002, RPT.004 and RPT.005, so OUT contains:
Code:
RPT.002
LINE 04
LINE 05
LINE 06
LINE 07
RPT.004
LINE 10
LINE 11
LINE 12
RPT.005
LINE 13
LINE 14
LINE 15
LINE 16
Is that what you wanted? _________________ 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 Thu Mar 31, 2005 6:49 pm; edited 3 times in total
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Mar 31, 2005 5:36 pm Post subject:
Coolman,
Ask your System Programmer to install the Dec, 2004 PTF (it's free). _________________ 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