how to update a global temporary table in a sub program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

how to update a global temporary table in a sub program

Postby samrat » Tue Feb 07, 2012 9:59 pm

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
samrat
 
Posts: 5
Joined: Tue Feb 07, 2012 9:46 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby enrico-sorichetti » Tue Feb 07, 2012 10:23 pm

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:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

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

Postby BillyBoyo » Tue Feb 07, 2012 10:44 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby samrat » Wed Feb 08, 2012 3:35 pm

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
samrat
 
Posts: 5
Joined: Tue Feb 07, 2012 9:46 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Wed Feb 08, 2012 4:25 pm

What didn't you understand about my reply?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby samrat » Wed Feb 08, 2012 5:11 pm

can i update a temporary table within a program without creating it inside that same program..pls suggest
samrat
 
Posts: 5
Joined: Tue Feb 07, 2012 9:46 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Wed Feb 08, 2012 5:35 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby samrat » Wed Feb 08, 2012 6:36 pm

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
samrat
 
Posts: 5
Joined: Tue Feb 07, 2012 9:46 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Wed Feb 08, 2012 7:17 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby samrat » Thu Feb 09, 2012 10:24 am

can i update a db2 temprary table without declaring it in the same program..please tel yes or no..
samrat
 
Posts: 5
Joined: Tue Feb 07, 2012 9:46 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post