I have a report file which contains multiple reports in the same file and I need to be able to select only a certain report based on a report number. For example the following sample
has 2 reports, the report numbers are 2000023 and 2000030 and I want to select only the report for 2000023 or only 2000030.
The start of each report can be identified by a 1 in line 2 (pos 17) and a report number (pos 19) in line 4 of each set of report.
The end of each report is identified by the line which contains 2994081.
The report is FBA LRECL 133
How do I do this with ICETOOL?
1
0 1
0 2008 12 28
0 2000023 الاشـــــتراكـات
1
0 2
0 2008 12 28
0 2000023 الاشـــــتراكـات
0
0 335 694 55 949 92 245 187 500 1864 966 614 966 1250 000 1864 966
0 15337 476 15947 182 609 706- لاجمـــــــــــــــــــــا لى
0-------------- --------------------- ------------------------------
0-------------- --------------------- ------------------------------
0 ( عة المؤسسه ÙˆØ§Ù„Ø£Ø³ØªÙØ³Ø§Ø± هات٠رقم 191 ادارة1لاشتراكات ورقم ÙØ§ÙƒØ³ 2994081
1
0 1
0 2008 12 28
0 2000030 الاشـــــتراكـات
1
0 2
0 2008 12 28
0 2000030 الاشـــــتراكـات
0
0 335 694 55 949 92 245 187 500 1864 966 614 966 1250 000 1864 966
0 15337 476 15947 182 609 706- لاجمـــــــــــــــــــــا لى
0-------------- --------------------- ------------------------------
0-------------- --------------------- ------------------------------
0 ( عة المؤسسه ÙˆØ§Ù„Ø£Ø³ØªÙØ³Ø§Ø± هات٠رقم 191 ادارة1لاشتراكات ورقم ÙØ§ÙƒØ³ 2994081
Thanks
Selecting sets of records in a report file
- Frank Yaeger
- Global moderator
- Posts: 1079
- Joined: Sat Jun 09, 2007 8:44 pm
- Skillset: DFSORT, ICETOOL, ICEGENER
- Referer: Search
- Contact:
Re: Selecting sets of records in a report file
Here's a DFSORT/ICETOOL job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to use DFSORT's WHEN=GROUP function. If you don't have that PTF, ask your System Programmer to install it.
Code: Select all
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYMNAMES DD *
* Specify the report number you want in the next line.
RPT_NUM,'2000023'
/*
//IN DD DSN=... input file (FBA/133)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file (FBA/133)
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'1'),
PUSH=(134:ID=8,SEQ=8))
OUTFIL FNAMES=T1,
IFTHEN=(WHEN=(142,8,ZD,EQ,4),
BUILD=(1,141,142:C'00000000',/,1,149))
/*
//CTL2CNTL DD *
SORT FIELDS=(134,8,ZD,A,142,8,ZD,A)
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(142,8,ZD,EQ,0),
PUSH=(150:19,7))
OUTFIL FNAMES=OUT,
INCLUDE=(142,8,ZD,NE,0,AND,150,7,CH,EQ,RPT_NUM),
BUILD=(1,133)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Join parts of two records from same file
by Mickes » Thu Apr 27, 2023 3:47 am » in DFSORT/ICETOOL/ICEGENER - 3
- 1226
-
by sergeyken
View the latest post
Sat Apr 29, 2023 1:32 pm
-
-
- 3
- 6777
-
by sergeyken
View the latest post
Sun May 01, 2022 11:26 pm
-
-
File def'n-problem with different records layouts
by ralph » Tue Oct 26, 2021 10:47 pm » in IBM Cobol - 2
- 1520
-
by ralph
View the latest post
Wed Oct 27, 2021 1:42 am
-
-
-
Split file, SORT then append records.
by Esmayeelhusen » Fri Aug 04, 2023 6:37 pm » in DFSORT/ICETOOL/ICEGENER - 10
- 5379
-
by Esmayeelhusen
View the latest post
Wed Aug 09, 2023 7:39 am
-
-
-
Create multiple records based on one record within a file.
by chillmo » Thu Aug 11, 2022 3:54 am » in Syncsort/Synctool - 5
- 7688
-
by sergeyken
View the latest post
Fri Aug 12, 2022 2:23 am
-