IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to count the detail record and has update in Footer rec


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Sat Jun 09, 2007 4:40 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Jun 09, 2007 9:42 pm
Reply with quote

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'))
/*
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Sun Jun 10, 2007 1:13 pm
Reply with quote

Hi frank,
Thank you...
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Tue Jun 12, 2007 1:11 pm
Reply with quote

Hi frank,
I got the exact output.
Thank you very much.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top