Please help, how to copy records uniquly from desired files.
i have 4 different files and 2 out of 4 files might have identical records in same position and of same length as below example:
file1:
AAAAAAA
BBBBBBB
CCCCCC
file2:
AAAAAAA
BBBBBBB
CCCCCC
file 3:
--
--
ZZZZZZZ
file 4:
--
--
ABABABA
Desired Output:
-----------------
AAAAAAA from file1 only
BBBBBBB from file2 only
CCCCCC from file1 only
ZZZZZZZ from file3
ABABABA from file4
or
AAAAAAA from file1 only
CCCCCC from file1 only
BBBBBBB from file2 only
ZZZZZZZ from file3
ABABABA from file4
Here for file1, search requirement is AAAAAA and CCCCCC
and for file2, search requirement is BBBBBBB
for rest, we have unique data.
If file1 or file2 is empty, then its corresponding records should not be copied into output file. Please suggest how to implement the above in a single DFSORT step.
You showed is a VISUAL rule by which BBBBBB is taken from file 2 ...
and everything else in <priority> according to the file sequence.
what is the algorithmic rule ???
since I guess the record shown are random patterns not representative of any data
Hi Enrico,
actually the 4 files contains sysout data from different programs and as per requirement i have to copy the program statistics into a single output file for further processing. example:
file1:
-
-
** number of records read: 50
** number of records write: 100
** number of records update: 500
file2:
-
-
** number of records read: 500
** number of records write: 1000
** number of records update: 50000
file3:
-
-
** records read: 50
file4:
-
-
** records write: 50
desired output:
-----------------
** number of records read: 50 (from file1)
** number of records write: 1000 (from file2)
** number of records update: 500 (from file2)
** records read: 50 (from file3)
** records write: 50 (from file4)
as both file1 and file2 have records with identical sysout data pleasase suggest how to get the output in a single DFSORT step.
hi,
the required 3 sysout records are always constant and identical in file1 and file2 and there is nothing to differentiate them except the count which is dynamic.
File3 and file4 has its unique constannt records so i can use
include cond=(1,16,CH,EQ,C'** records read:') OR
(1,20,CH,EQ,C'** records write:') to get the records copy into output.
As per the requirement, i have to copy 4 different programm statististics on daily basis.
in step1: i am extracting all 4 sysout into 4 different files of same length(90) from beta92 using program 'BST01RFF'.
step2: as my requirement is to copy only specific program statistics records, i am trying to use DFSORT on file1,2,3 and file4.
But file1 and file2 files are having same identical statistic records with same starting position and length as in respective program1 and program2, we have identical display statements but different count as extracted from beta92 as below:
file1:
------
** number of records read: 50
** number of records write: 100
** number of records update: 500
file2:
------
** number of records read: 9000
** number of records write: 100000
** number of records update: 500000000
file3 and file4 have different program display statements like
file3:
-
-
** records read: 50
file4:
-
-
** records write: 50
the output file should contain
'** number of records read:' & '** number of records update:' from file1
'** number of records write:' from file2.
** records read: from file3 and
** records write: from file4.
the desired output should be:
** number of records read: 50
** number of records write: 100000
** number of records update: 500
** records read: 50
** records write: 50
in file1 and file2 there is nothing to differentiate them except the count which is dynamic.
Is it possible to extract only the required rows while extracting from beta92 using 'BST01RFF' so that i can extract 2 required rows from sysout1 and 1 required row each from file2,file3 and file4.
Please answer ALL of my questions. Each and every detail I asked for.
Hi,
please find the followings:
1. What is the LRECL and RECFM of the syslog datasets that you want the data to be extracted.
All files have LRECL = 90 & RECFM = FB
2.Is there anything in these files to identify them uniquely? any header or a flag?
Yes we have different header for each file. As below:
file1:
** Successful completion of PGM1
-------------------------------------------
** number of records read: 50
** number of records write: 100
** number of records update: 500
-------------------------------------------
File2:
** Successful completion of PGM2
-------------------------------------------
** number of records read: 50000
** number of records write: 10000
** number of records update: 500
-------------------------------------------
File3:
** Successful completion of PGM3
-------------------------------------------
** records read: 50
-------------------------------------------
File4:
** Successful completion of PGM4
-------------------------------------------
** records write: 50
-------------------------------------------
3. If your intention is to just extract the read and write count from file 1 and file2, why do you need file 3 and file4?
requirement is to get count for 4 different programs and each file contains count from its respective program.
Read and write count of pgm1 from file1.
Update count of pgm2 from file2
Read count of pgm3 from file3
Write count of pgm4 from file4.
4. Last but not least run the following Job and show us the sysout which will help us determine the level of DFSORT you have.
1ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 E9-K60824 C9-BASE E5-K76585 E7-K70685
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 08:22 ON TUE MAR 26, 2013 -
0 OPTION COPY 00070001
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 E9-K60824 C9-BASE E5-K76585 E7-K70685
ICE142I 0 SORTMSG NOT FOUND - SYSOUT USED
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE088I 0 QXA4532A.STEP0100. , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,12582912,12569694)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (12492254,12492254)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256
ICE128I 0 OPTIONS: SIZE=12582912,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=ABEND,MSGDDN=SYSOUT
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=FULL ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=N ,ABCODE=MSG
ICE130I 0 OPTIONS: RESALL=65536,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,COBEXIT=COB2
ICE131I 0 OPTIONS: TMAXLIM=12582912,ARESALL=0,ARESINV=0,OVERRGN=0,CINV=Y,CFW=Y,DSA=0
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N
ICE133I 0 OPTIONS: HIPRMAX=0 ,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
ICE751I 1 EF-BASE F0-K66717 E8-K79103
ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 0, OUT: 0
ICE173I 0 NO RECORDS FOR THE SORTOUT DATA SET - RC=0
ICE052I 0 END OF DFSORT
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
concatenate all the 4 files to SORTIN DD and then pick the values
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
** SUCCESSFUL COMPLETION OF PGM1
-------------------------------------------
** NUMBER OF RECORDS READ: 50
** NUMBER OF RECORDS WRITE: 100
** NUMBER OF RECORDS UPDATE: 500
-------------------------------------------
** SUCCESSFUL COMPLETION OF PGM2
-------------------------------------------
** NUMBER OF RECORDS READ: 50000
** NUMBER OF RECORDS WRITE: 10000
** NUMBER OF RECORDS UPDATE: 500
-------------------------------------------
** SUCCESSFUL COMPLETION OF PGM3
-------------------------------------------
** RECORDS READ: 50
-------------------------------------------
** SUCCESSFUL COMPLETION OF PGM4
-------------------------------------------
** RECORDS WRITE: 50
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,13,CH,EQ,C'** SUCCESSFUL'),
PUSH=(91:ID=1))
OUTFIL BUILD=(1,90),
INCLUDE=((91,1,ZD,EQ,1,AND,4,20,CH,EQ,C'NUMBER OF RECORDS READ'),
OR,
(91,1,ZD,EQ,2,AND,4,21,CH,EQ,C'NUMBER OF RECORDS WRITE'),
OR,
(91,1,ZD,EQ,1,AND,4,22,CH,EQ,C'NUMBER OF RECORDS UPDATE'),
OR,
(91,1,ZD,EQ,3,AND,4,11,CH,EQ,C'RECORDS READ'),
OR,
(91,1,ZD,EQ,4,AND,4,12,CH,EQ,C'RECORDS WRITE'))
//*
The output from the above is
Code:
** NUMBER OF RECORDS READ: 50
** NUMBER OF RECORDS UPDATE: 500
** NUMBER OF RECORDS WRITE: 10000
** RECORDS READ: 50
** RECORDS WRITE: 50