Posted: Mon Jul 06, 2015 11:47 am Post subject: DFSORT Multiple IFTHEN=(WHEN
Hi,
I am just trying to extract some information from SARLOG. Sarlog has multiple job log, I could restrict the information by provding following condition.
Code:
INCLUDE COND=((02,07,CH,EQ,C'* END *',AND,
64,07,CH,EQ,C'CA VIEW'),OR,
(02,16,CH,EQ,C'INSERT ROW COUNT'),OR,
(02,01,CH,EQ,C'H',AND,
09,18,CH,EQ,C'RESTART DATA SAVED'))
File1
Code:
H1300- RESTART DATA SAVED/INSERTED=\ZZZ25SCP\ZZZ25S23\2015-07-03\N\YYY_QQQQ_IIII_SSS \0000000000
INSERT ROW COUNT = 000037824
* END ************************************* CA VIEW *******************************
H1300- RESTART DATA SAVED/INSERTED=\ZZZ34QQ \ZZZ30S21\2015-07-03\N\YYY_WWWWWWW \0000000000
INSERT ROW COUNT = 0072836
* END ************************************* CA VIEW *******************************
H1300- RESTART DATA SAVED/INSERTED=\ZZZ35QQ \ZZZ30S22\2015-07-03\N\YYY_WWWWWWW_SSS \0000000000
INSERT ROW COUNT = 0010018
* END ************************************* CA VIEW *******************************
H1300- RESTART DATA SAVED/INSERTED=\ZZZ44QQ \ZZZ22S21\2015-07-03\N\UUU7X24 \0000000000
INSERT ROW COUNT =2488741
INSERT ROW COUNT =2511092
INSERT ROW COUNT =2522681
INSERT ROW COUNT =2644465
INSERT ROW COUNT =2723244
INSERT ROW COUNT =2858500
INSERT ROW COUNT =2875591
INSERT ROW COUNT =3154991
INSERT ROW COUNT = 3170564
* END ************************************* CA VIEW *******************************
H1300- RESTART DATA SAVED/INSERTED=\ZZZ45QQ \ZZZ22S22\2015-07-03\N\UUU7X44_SSS \0000000000
INSERT ROW COUNT =0218949
INSERT ROW COUNT = 0649236
* END ************************************* CA VIEW *******************************
H1300- RESTART DATA SAVED/INSERTED=\PPP1AQQ3\RRR1AS1 \2015-07-03\N\YYY_PPPQA_MOD \0000000000
INSERT ROW COUNT = 0166084
* END ************************************* CA VIEW *******************************
H1300- RESTART DATA SAVED/INSERTED=\PPP1AQQ5\AAA1AS3 \2015-07-03\N\YYY_PPPQA_MOD_SSS \0000000000
INSERT ROW COUNT = 0023167
* END ************************************* CA VIEW *******************************
Expected output is as follows. If we notice, UUU7X24 has multiple insert count, But we need only last count of the job and Time which is available in File2
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(4,8,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(1,8,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,45,F2:9,8)
INCLUDE COND=(1,3,CH,EQ,C'IRC')
SORT FIELDS=(4,26,CH,A,42,4,CH,D) $42,4 is a seqnum to find last insert count record
OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(4,26),RECORDS=1,
PUSH=(54:ID=1)) $set values for last insert count of the job
OUTFIL INCLUDE=(54,1,CH,NE,C' '), $remove other insert counts
BUILD=(4,26,30,12,SQZ=(SHIFT=LEFT,PREBLANK=C'='),
C',',46,08) $ remove "=" symbols
//JNF1CNTL DD *
OPTION COPY
INCLUDE COND=((02,07,CH,EQ,C'* END *',AND,
64,07,CH,EQ,C'CA VIEW'),OR,
(02,16,CH,EQ,C'INSERT ROW COUNT'),OR,
(02,01,CH,EQ,C'H',AND,
09,18,CH,EQ,C'RESTART DATA SAVED'))
INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,1,CH,EQ,C'H'),
END=(2,7,CH,EQ,C'* END *'),
How about get rid of the SORT, and use OUTFIL with REMOVECC,NODETAIL and SECTIONS for your key and with TRAILER3 producing the record (it will do so with the last data record, which is the one you want.
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