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

How to define a table dynamically in Cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Mon Sep 11, 2006 12:28 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top