Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Luixx (Programmer) (OP)
12 Sep 08 7:23

How can I know the number of records in an indexed file?

(I'd like to have a progress bar.) (Liant Cobol runtime 11)

mrregan (MIS)
12 Sep 08 7:28
The only way I know to find the number of records in the
RM Cobol Indexed file is to use the recovery utility which
displays the number of records in the file before it attempts to rebuild the indexes.
Helpful Member!(2)  theotyflos (Programmer)
12 Sep 08 9:07
There was once a Liant utility called RMRECS.COB that did exactly that job. I don't know if it exists now in their site. If there aren't any license issues I could attach it here.

Hope it helps.



A few weeks of trial and error can spare you lots and lots of minutes reading the manual.

theotyflos (Programmer)
12 Sep 08 9:38
You can also try the following:


      *           Find Number of records in an indexed file            *
       Identification Division.
       Program-Id.    Num-Of-Recs.
       Author.        Theophilos Kanoutas.

      *            E N V I R O N M E N T    D I V I S I O N            *
       Environment   Division.
       Configuration Section.
           Decimal-Point Is Comma.

       Input-Output  Section.
           Select                     Idx-Fil
                  Assign To Disk      Idx-Path
                  Organization Binary Sequential Access Sequential
                  File Status         FlSt.

      *                    D A T A    D I V I S I O N                  *
       Data Division.
       File Section.
       Fd  Idx-Fil.
       1   Idx-Rec.
           2                   Pic x(50).
           2   Idx-Num-Recs    Pic 9(9)    Binary(4).
           2                   Pic x(10).
       Working-Storage Section.
       1   Idx-Path            Pic x(255).
       1   FlSt                Pic xx.
       1                       Pic x.
        88 Error-On-File           Value "Y" False "N".
       1   Chr                 Pic x.

      *                 P R O C E D U R E   D I V I S I O N            *
       Procedure Division.
       Dcl-Idx-Section Section.
           Use After Standard Error Procedure On Idx-Fil.
           Set Error-On-File To True.
       End Declaratives.
       Main Section.
           Display   Spaces Erase
           Accept    Idx-Path Tab Prompt No Beep

           Set       Error-On-File To False
           Open      Input Idx-Fil
           If        Error-On-File
             Display "Error " FlSt " Opening File"
           Set       Error-On-File To False
           Read      Idx-Fil
           If        Error-On-File
             Display "Error " FlSt " Reading File"
           Close     Idx-Fil
           Display   "Number Of Records:" Idx-Num-Recs Convert
           Display   "Press Enter"
           Accept    Chr Col 0
       End Program Num-Of-Recs.



A few weeks of trial and error can spare you lots and lots of minutes reading the manual.

Luixx (Programmer) (OP)
12 Sep 08 10:44
Wooow! thank you very much Theophilos. That is just PERFECT!!

It's just magic!

I've been searching in their site all around, google, yahoo, etc and found nothing about RMRECS.COB

This solution is even better, it's perfect!

I've wanted it for like 2 or 3 years!

Thank You Again!

If there is anything I can do, just ask!

Luis (PT).
k5tm (Programmer)
12 Sep 08 21:35

Micro Focus (Liant) support could have provided that utility to you for the asking, and still can.

Just go to the support web page and enter a support request.  It has recently been updated to return error information.


Tom Morrison

k5tm (Programmer)
12 Sep 08 21:37
I should add the web address of the support request page.
baruch (MIS)
20 Sep 08 11:53
In the header of the index or relative file, there is information about the file like key descriptions, & counts of alive records & deleted records.

If you read the file as binary file,
position 47-54 contain the number of records in the file (format: pic 9(12) comp-4).
razalas (Programmer)
1 Oct 08 17:59
RM/Cobol includes the "rmmapinx" utility which also gives the record count, as well as a whole lot of other information about an indexed file.  See Appendix G in the RM/Cobol Users Guide.

The program Theotflyos is pretty nice, but personally, I would tend to avoid homegrown solutions like that in case the underlying implementation is changed by the vendor.

Code what you mean,
and mean what you code!
But by all means post your code!


Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close