ibmmainframesyntel
Active User
Joined: 26 Feb 2007 Posts: 126 Location: Chennai
|
|
|
|
Hi Frank,
I/P File
--------
A1 Filename Comparision1>>>>>>>>>>>>>>>>>>>>>>>> Filename
F1 E1 C 00000015
F1 E1 R 00000011
V1 E1 R 00000011
V3 E1 R 00000011
V2 E1 R 00000011
Z1 00000000 00000000 00000000
A1 Filename Comparision2>>>>>>>>>>>>>>>>>>>>>>>> Filename
F2 E1 C 00000015
F1 E1 R 00000011
F2 E1 R 00000011
V1 E1 R 00000011
V1 E1 R 00000011
Z1 00000000 00000000 00000000
A1 Filename Comparision3>>>>>>>>>>>>>>>>>>>>>>>> Filename
F1 E1 C 00000015
V1 E1 R 00000011
Z1 00000000 00000000 00000000
In the above file,
The record starts with 'A' is the 1st position is the header record.
The record starts with 'Z' is the 1st position is the Footer record.
The record starts with 'F' and 'V' is the 1st position is the body(detail) record.
Ths set which contains 'A','F','V' and 'Z' is the one set of block.
Like that it contains more than 6 set of block.
My requirements is
1) to count the number of 'F' in 1st position and it should be updated in
4th- 11th position in Footer record('Z' type record)
2)to count the number of 'V' in 1st position and it should be updated in
13th-20th position in Footer record('Z' type record)
My output should be,
Output file
----------
A1 Filename Comparision>>>>>>>>>>>>>>>>>>>>>>>> Filename
F1 E1 C 00000015
F1 E1 R 00000011
V1 E1 R 00000011
V3 E1 R 00000011
V2 E1 R 00000011
Z1 00000002 00000003 00000000
A1 Filename Comparision>>>>>>>>>>>>>>>>>>>>>>>> Filename
F2 E1 C 00000015
F1 E1 R 00000011
F2 E1 R 00000011
V1 E1 R 00000011
V1 E1 R 00000011
Z1 00000003 00000002 00000000
A1 Filename Comparision>>>>>>>>>>>>>>>>>>>>>>>> Filename
F1 E1 C 00000015
V1 E1 R 00000011
Z1 00000001 00000001 00000000
LRECL=133,RECFM=FB
If you have any query let me know. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/133)
//SORTOUT DD DSN=... output file (FB/133)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,OVERLAY=(135:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(1,1,CH,EQ,C'A'),
OVERLAY=(135:SEQNUM,8,ZD)),
IFTHEN=(WHEN=NONE,
OVERLAY=(143:SEQNUM,8,ZD,
135:135,8,ZD,SUB,143,8,ZD,M11,LENGTH=8))
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(151:16C'0')),
IFTHEN=(WHEN=(1,1,CH,EQ,C'F'),OVERLAY=(151:C'00000001')),
IFTHEN=(WHEN=(1,1,CH,EQ,C'V'),OVERLAY=(159:C'00000001'))
OUTFIL REMOVECC,
OMIT=(1,1,CH,EQ,C'Z'),
BUILD=(1,133),
SECTIONS=(135,8,
TRAILER3=('Z1 ',TOT=(151,8,ZD,M11,LENGTH=8),X,
TOT=(159,8,ZD,M11,LENGTH=8),X,
C'00000000'))
/*
|
|
|