Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to display offset thru cobol prog... tvinodkumar7 CICS 0 Sun Apr 22, 2018 8:42 pm
No new posts Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 4 Fri Apr 20, 2018 4:17 pm
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts How do I define a DB2 plan for a web ... John Poulakos CICS 4 Sat Apr 14, 2018 1:58 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us