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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm


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