Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to define a table dynamically in Cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Mon Sep 11, 2006 11:51 am    Post subject: How to define a table dynamically in Cobol
Reply with quote

Hi All, can any one of you please let me know how to DEFINE A TABLE Dynamically in the Cobol Program?

Thanks!
Rathna.
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Mon Sep 11, 2006 12:28 pm    Post subject:
Reply with quote

The answer is in the fine manual.

O.
Back to top
View user's profile Send private message
vin12pr
Warnings : 1

New User


Joined: 14 Jun 2006
Posts: 56

PostPosted: Mon Sep 11, 2006 2:10 pm    Post subject: Re: How to define a table dynamically in Cobol
Reply with quote

Here is a example:

WORKING-STORAGE-SECTION

01 WS-MONTH-DAY-CALENDER.
05 WS-DAY PIC 9(2) OCCURS 1 TO 31 TIMES DEPENDING ON WS-OCCURENCE.

PROCEDURE DIVISION.

IF MONTH = 'FEB' THEN
MOVE 28 TO WS-OCCURENCE

.
.

Based on the value you pass in the procedure division to the WS-OCURENCE vatriable the size of the table will be decided.

Hope it is clear now.
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Mon Sep 11, 2006 6:25 pm    Post subject: Re: How to define a table dynamically in Cobol
Reply with quote

Hi Thank you very much for your reply. That means creating variable lenght of the tables(OCCURS DEPENDING ON variable-name) are called DYNAMIC, and Fixed lenght of the Tables are called STATIC?

Thanks!
Rathna.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us