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
 
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: 7315

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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

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