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: 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 BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 1 Tue Jul 25, 2017 12:12 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm


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