Page 1 of 2

how to update a global temporary table in a sub program

PostPosted: Tue Feb 07, 2012 9:59 pm
by samrat
i have a main program which has a global temporary table.it is created in the main program
i have a sub program which is updating that temporary table created in the main program.
please suggest how can i update in the sub program the global temporary table which is been created in the main program
please respond quickly as needed in urgency.
for ur info:the main program is calling the sub-program

Re: how to update a global temporary table in a sub program

PostPosted: Tue Feb 07, 2012 10:23 pm
by enrico-sorichetti
please respond quickly as needed in urgency.


as usual.... asking on a forum is not the best place if You have time issues

there is no agreement or commitment on providing replies,
furthermore people provide help on their own time and free of charge
so You should expect people to reply according to their priorities, not Your

it would be wise for You to read and meditate on
how to ask questions the smart way
here http://catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here http://support.microsoft.com/kb/555375

both essyas are very useful to... forecast the comments and bashings You might receive :geek:

Re: how to update a global temporary table in a sub program

PostPosted: Tue Feb 07, 2012 10:44 pm
by BillyBoyo
If the main module is calling the sub-module, did you try just passing it on the CALL USING to PROCEDURE DIVISION USING?

If that doesn't help, show us your definitions and relevant procedure code. Inside the Code tags, please.

Why do you need a quick answer? As enrico suggests, there are better places for that.

Re: how to update a global temporary table in a sub program

PostPosted: Wed Feb 08, 2012 3:35 pm
by samrat
can i update the temporary table in a sub program if it is been created in the main program,

i havent stil written the main program.
the main program will contain the the declaration of the temporary table.
can i update the global temporary table in subprogram without creating it inside the sub program as in this case the main program

Re: how to update a global temporary table in a sub program

PostPosted: Wed Feb 08, 2012 4:25 pm
by BillyBoyo
What didn't you understand about my reply?

Re: how to update a global temporary table in a sub program

PostPosted: Wed Feb 08, 2012 5:11 pm
by samrat
can i update a temporary table within a program without creating it inside that same program..pls suggest

Re: how to update a global temporary table in a sub program

PostPosted: Wed Feb 08, 2012 5:35 pm
by BillyBoyo
What do you mean by "creating" it?

There has to be a data definition. If that data definition is in the Linkage Section, then the storage for it has been acquired elsewhere.

Please show at least what you want to define.

Re: how to update a global temporary table in a sub program

PostPosted: Wed Feb 08, 2012 6:36 pm
by samrat
im using the following query in my sub program

UPDATE TEMP A
SET BATCH RUN FLAG = 7 ,
SKU_LOC_LVL_COMMENT_CDE = 1
WHERE AVAIL_CDE = 7

but when im compile it givin complition error,as the tabel is not declared in the sub program
i want to know can i somehow update the temporayry table using the above query without declaring it in the program

Re: how to update a global temporary table in a sub program

PostPosted: Wed Feb 08, 2012 7:17 pm
by BillyBoyo
So it was a DB2 table all along?

I suggest you find some example Cobol programs, at your site or using google or searching/browsing here, and compare to what you have.

Re: how to update a global temporary table in a sub program

PostPosted: Thu Feb 09, 2012 10:24 am
by samrat
can i update a db2 temprary table without declaring it in the same program..please tel yes or no..