Selecting sets of records in a report file



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Selecting sets of records in a report file

Postby tsdjim » Tue Jan 27, 2009 11:09 pm

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
tsdjim
 
Posts: 18
Joined: Mon Nov 03, 2008 1:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Selecting sets of records in a report file

Postby Frank Yaeger » Wed Jan 28, 2009 2:14 am

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.

//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
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post