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
 

 

Doubts related to insertion of table values

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

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Tue Apr 24, 2012 11:54 am    Post subject: Doubts related to insertion of table values
Reply with quote

Hi,

Please find below code:

Code:
PARA-ABCD.
  PERFORM PARA1
  PERFORM PARA2.


PARA1.
 PERFORM PARA3
 IF A<=B
  PERFORM POPULATE-TABLE1-PARA
  PERFORM INSERT-TABLE1-PARA
END-IF.


PARA2.
 PERFORM PARA4
IF A<=B
  PERFORM POPULATE-TABLE1-PARA
  PERFORM INSERT-TABLE1-PARA
END-IF.


POPULATE-TABLE1-PARA.
 INITIALISE TABLE1
 MOVE WS-VARIABLES TO TABLE-DECLGEN-FIELDS.


INSERT-TABLE1-PARA.
 IN THESE PARA INSERT STATEMENT IS PRESENT.



I have above logic in my program from buisness point of view.So i am unable to understand as in table two times insert is done so will it append the table values second time while doing insertion or due to intialise verb will it insert new values in table from paraB when both paraA and paraB will get perfromed for A<=B condition.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Tue Apr 24, 2012 12:11 pm    Post subject: Reply to: Doubts related to insertion of table values
Reply with quote

I'm not sure I understand the question.

The INITIALIZE is doing nothing other than setting the values of items to which it applies to zero or space depending on whether they are numeric or alphanumeric. It is not doing anything else.

If A is not greather than B, then

Code:
PARA3
POPULATE-TABLE1-PARA
INSERT-TABLE1-PARA
PARA4
POPULATE-TABLE1-PARA
INSERT-TABLE1-PARA


Will all be performed, unless there is any code in any of the paragraphs which changes the value of either A, B or both, in which case different things will happen.

But, on the fact of it, INSERT-TABLE1-PARA will be performed twice. What happens depends on the code in that paragraph.

Can you show the contents of TABLE1 and the MOVEs which follow the INITIALIZE?
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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