Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading data into a temp file, to display on screen

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I want to load (up to 200 records) in a table that I can access and request to print (on screen) 15 records at a time.
 
Hello Bead2

First, What development environment are you using?

I'm supposing you are using a GUI development like Powercobol because it use a table grid.
If it's so, you can load up to 2000 record in a table.

Instead, if you are using a Text mode development environment, it is so hard to load up to 200 records:
It depending from various situations:
1) How long is each record in characters?
2) How many fields contains each records and so on...
3) Working storage memory problems!!

Before to let you know how to implement a solution to resolve your problems, i need to know the name of the development environment you are using.

Let me know..
Gianni


 
bead2,

to break your problem down into a couple of bite-size chunks:

define a table that can hold 200 of your input records. Each table element can have the same layout as such a record, or whichever fields you wish to display.

Create a part in the program that reads the input file and fills the table with it.

Now you should have a filled table; next, create a part in your program that displays 15 subsequent table elements at a time, including some user interaction to request the next set of 15.

Any specific questions sofar ? Let us know.

Regards,
Ronald.
 
I am using microfocus cobol. List of names, addresses, phone numbers that I have already sorted by name and now I want to display them on the screen. I have over 100 names and addresses, but I can only display 12 records at a time and I want to display the total amount of names and addresses on several different screens.
 
Hello. I just answered one of your questions, where you wanted to display 20 records at a time. There, it was a matter of reading your file, and as you read each record, you do something with it i.e. load it into a working storage table.

You can do the same sort of thing here; load up a working storage table which has 200 occurrences. Each time you read a record, move it into the next occurrence until you get to the end of the file. Make sure that you include a counter so that you can count the number of records that you actually have.

Then when you get ready to process your loaded table, do a routine which will display (or whatever you are doing with each record) and which will count each record from the working storage table. You do this as a PERFORM UNTIL INDEX (or SUBCRIPT) > NUMBER-OF-RECS.

Every time you process a record, you divide 15 into the record count. If the remainder is zero, then you are at the point of 15th record or a multiple of 15. So then you do whatever you plan to do each time you reach 15 or a multiple of 15.

I don't have microfocus COBOL; we just have a big, huge mainframe system and we use an emulator on our PC which gives us access to the mainframes. We use ENDEVOR for compiling, linking, etc.

Hope this helps, Nina Too
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top