Number of records in the Flat file

Tags:
390
Application development
Career Development
Data analysis
DataCenter
Development
IBM DB2
Mainframe
zSeries
I have a huge Flat file in the Mainframe. What is the quickest way (utility, TSO command or TSO function) to find the exact number of records in the file? Thank you for your help!

Answer Wiki

Thanks. We'll let you know when a new response is added.

IBM sort utility ICETool have a COUNT function that is what
you need.

Discuss This Question: 11  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Mikeshor
    If the file is fixed or fixed block, I would go to ISPF option 3.2, ask for information on the file and divide the space that it takes up by the LRECL
    0 pointsBadges:
    report
  • DDekreon
    select count(*) from tablename (sql)
    15 pointsBadges:
    report
  • Chavan
    I think whether you go for PCSHELL utility you will be get easily and exact result. Thnks.
    0 pointsBadges:
    report
  • Wadoman
    I would use an IDCAMS REPRO. Using the same space requirements as your original file, repro the file to a new file. The output from your JCL should give you the exact number of records copied from the one file to the other. Another way is to use a SELCOPY, but the REPRO will be the quickest of the two. Hope this helps.
    0 pointsBadges:
    report
  • Jamig77
    the fastest most efficient way is to use idcams with jcl. use the print command, it will return the exact number of records, sort will work, and is good, but you still use too much system resource tso editor is again a hog sql is fine - again the overhead and up front work to run the query against it
    0 pointsBadges:
    report
  • Anettis
    Simply view the file under ISPF, max to the bottom, and look left to the last line number - BINGO. Now if you are talking about doing it programatically - that is another story.
    0 pointsBadges:
    report
  • Garth1m
    Goto ISPF browse on the file L 9999999 Locates the last line I think it's quicke than using max but haven't tested it The other space calculation methods may give you approximations.
    0 pointsBadges:
    report
  • DennisW
    Several of the suggestions in previous replys should work. An IDCAMS print would seem the most accurate, just put output to a DD DUMMY or you might never compete the run for a large file. There may be a message with how many records were written to the file in a the log of the job that wrote it - if still available and the program or utility used displayed this information.
    0 pointsBadges:
    report
  • Fskovacs
    If the file is so large that ISPF is problematical, I use SORT with SYSIN as SORT FIELDS=COPY and SORTOUT going to DUMMY. The record count will be in SYSPRINT
    0 pointsBadges:
    report
  • Anettis
    L 999999 may not work if the file is too large. And if it did work I don't see how its performance would be any different than using MAX page down (PF8). As a flag (QSAM) file the only way to reach the end of the file is to read each record.
    0 pointsBadges:
    report
  • jkgala

    IBM sort utility ICETool have a COUNT function that is what
    you need.

    here an example

    //STEP02   EXEC PGM=ICETOOL                                             
    //IN       DD  DSN=BCST.INH.GP01.AFTER.POST.TLPFLAP,DISP=SHR            
    //OUT      DD  SYSOUT=*                                                 
    //SYSOUT   DD  SYSOUT=*                                                 
    //TOOLIN  DD *                                                          
      COUNT FROM(IN) WRITE(OUT) DIGITS(09)                                  
    /*                                                                      
    //TOOLMSG DD SYSOUT=*                                                   
    //DFSMSG  DD SYSOUT=*                                                   
    //*    TO COUNT USING A PARTICULAR CONDITION                            
    //*       //TOOLIN  DD *                                                
    //*       COUNT FROM(IN) WRITE(OUT) DIGITS(8) USING(CTL1)               
    //*       /*                                                            
    //*       //CTL1CNTL DD *                                               
    //*       INCLUDE COND=(5,4,CH,EQ,C'SWAP')                              
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following