declare cursor in CICS and sqlcode = -904



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

declare cursor in CICS and sqlcode = -904

Postby ChenTao » Thu Nov 01, 2012 5:19 pm

here is my code,
it's in CICS environment:
EXEC SQL
DECLARE CUR1 INSENSITIVE SCROLL CURSOR
FOR SELECT GOODID,INDATE,INPIECE
FROM STSTORAGE
WHERE GOODID = :COMM-GOID
i,debug the program in the CEDF ,and when the program comes to this sentence, the sqlcode returned -904,the table exists.
i don't konw if i should do something special to execute this sentence. i use scrollble cursor the first time.
ChenTao
 
Posts: 8
Joined: Thu Nov 01, 2012 5:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: declare cursor in CICS and sqlcode = -904

 

Re: declare cursor in CICS and sqlcode = -904

Postby Pandora-Box » Thu Nov 01, 2012 5:31 pm

Is the tablespace in RW mode?

To check that try to execute the command

-DIS DB(<DATABASE>) SPACE(<TABLESPACE>)
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: declare cursor in CICS and sqlcode = -904

Postby ChenTao » Thu Nov 01, 2012 7:30 pm

premkrishnan wrote:Is the tablespace in RW mode?

To check that try to execute the command

-DIS DB(<DATABASE>) SPACE(<TABLESPACE>)


i'm sorry,i don't define any tablespace before i execute this program, and don't know how to and why i must define the tablespace, and maybe it's the reason why i can't execute the program correctly. :(
here is the error information, wish it help.
SQLCABC = 136
SQLCODE = -904
SQLERRMC = 'UPDATABLE WORKFILE,100,TEMP DATABASE '
SQLERRP = 'DSNXISCR'
......
By the way , where should i input the command you said before? i have been stuck in this proble for two days. i want to scroll page up and down to show all records in the map, maybe it's too hard for me.. :(
ChenTao
 
Posts: 8
Joined: Thu Nov 01, 2012 5:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: declare cursor in CICS and sqlcode = -904

Postby Pandora-Box » Thu Nov 01, 2012 7:52 pm

-DIS DB(<DATABASE>) SPACE(<TABLESPACE>)


could be executed as job too using

//STEP01 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(<SSID>)
-DIS DB(<DATABASE>) SPACE(<TABLESPACE>)
END
//SYSIN DD DUMMY


You need get the Database and Tablespace where your table resides and execute the job

The reason why I am asking to execute the command is to check if the Tablespace is in RW mode (Read write)

You would get -904 also when your table is in check pending , Recover pending , Copy pending etc
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: declare cursor in CICS and sqlcode = -904

Postby Pandora-Box » Thu Nov 01, 2012 7:55 pm

Do you use any of the tools

Db2 admin tool,BMC,Platinum?
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: declare cursor in CICS and sqlcode = -904

Postby ChenTao » Thu Nov 01, 2012 8:08 pm

premkrishnan wrote:Do you use any of the tools

Db2 admin tool,BMC,Platinum?


maybe i'm too beginner...
i haven't learned nothing but program on the MVS for about 2 months. i wish you can tell me some essential knowledge i should know before i can handle this problem. thank you.
is the problem occurs because i haven't define the tablespace ?
ChenTao
 
Posts: 8
Joined: Thu Nov 01, 2012 5:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: declare cursor in CICS and sqlcode = -904

Postby Pandora-Box » Thu Nov 01, 2012 8:14 pm

For a quick fix do you have any mentor in your team whom you could reach for help?
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: declare cursor in CICS and sqlcode = -904

Postby ChenTao » Thu Nov 01, 2012 8:27 pm

i got no one to reach for :( , i'm a student and i have 5 parterner in my group, i'm sorry but i'm the group leader. we both want to fulfill scroll page , and i'm the one who are occupid to finish this job. besides this problem, we both did well :) . now we have no teacher, but we all try our best to use what we have learned. maybe i should learn more and than come back for this problem.
ChenTao
 
Posts: 8
Joined: Thu Nov 01, 2012 5:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: declare cursor in CICS and sqlcode = -904

Postby Pandora-Box » Thu Nov 01, 2012 8:59 pm

What I would say is try to identify the database and tablespace of your table STSTORAGE you can get

So to get that you need to write a query to SYSIBM.SYSTABLES to get DBNAME and TSNAME of your table

So query will be

SELECT DBNAME , TSNAME FROM SYSIBM.SYSTABLES WHERE NAME ='STSTORAGE'


After that you get the name of your table's Database and Tablespace

With that value

Substitute in the job I gave earlier and execute it.

and let me know the output you get
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: declare cursor in CICS and sqlcode = -904

Postby ChenTao » Thu Nov 01, 2012 9:11 pm

premkrishnan wrote:What I would say is try to identify the database and tablespace of your table STSTORAGE you can get

So to get that you need to write a query to SYSIBM.SYSTABLES to get DBNAME and TSNAME of your table

So query will be

SELECT DBNAME , TSNAME FROM SYSIBM.SYSTABLES WHERE NAME ='STSTORAGE'


After that you get the name of your table's Database and Tablespace

With that value

Substitute in the job I gave earlier and execute it.

and let me know the output you get


thank you very much! i will try tomorrow when i go to school, since it's already been bed time, tomorrow morning i will have a try and then give you a reply .
ChenTao
 
Posts: 8
Joined: Thu Nov 01, 2012 5:02 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post