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

loading record in a fixed length table in cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Fri Feb 13, 2009 6:00 pm
Reply with quote

hi ,

in my file i have 3000 records and i have declared a table with 2000 occurs in cobol program .

when i tried to load the table, will all the record get processed or only first 2000 record will be loaded in table and processed

regards,
rupesh gupta
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Feb 13, 2009 6:18 pm
Reply with quote

well let's see now:
3000 records in file
2000 occurs in table
==================
1000 records without a home.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Feb 13, 2009 6:45 pm
Reply with quote

rupesh gullu wrote:
will all the record get processed or only first 2000 record will be loaded in table and processed
That depends on what your program does when it reads the 2001st record.......
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Feb 13, 2009 10:56 pm
Reply with quote

You could either write a callable REXX routine, which issues a LISTDSI command or write a small callable Assembler sub-program, which issues a SHOWCB Macro.

In either case, the number of records on the file is returned to you.

Then, in your COBOL program, calculate the amount of storage you'll need by multiplying the NUMBER OF RECORDS by the file's LRECL. Use this calculated storage amount as a parameter to call LE Callable Storage routine CEEGTST and dynamically obtain the required storage.

Note that the table would have to be moved to LINKAGE, but, dynamically allocating the storage will potentially remove the possibility of the internal table from ever being too small.

Regards,
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Load new table with Old unload - DB2 DB2 6
Search our Forums:

Back to Top