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 how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm


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