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
 

 

DSNH080I-error: UNACCEPTABLE SQL STATEMENT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> ABENDS & Debugging
View previous topic :: :: View next topic  
Author Message
Baskaran
Warnings : 1

New User


Joined: 24 Oct 2006
Posts: 32
Location: India

PostPosted: Mon Apr 30, 2007 1:09 pm    Post subject: DSNH080I-error: UNACCEPTABLE SQL STATEMENT
Reply with quote

Hi,

I'm very new with mainframe and appreciate all the help I can get.

In Working-storage section,

01 WS-SQL PIC X(400) VALUE SPACES.

01 WS-SQL-STR.
49 WS-SQL-LEN PIC 9(4) USAGE BINARY.
49 WS-SQL-TXT PIC X(400).

In Procedure division,

... A SELECT stmt is being strung into WS-SQL bases on a
conditional stmt
...
MOVE WS-SQL TO WS-SQL-TXT.

EXEC SQL
PREPARE STRSQL FROM :WS-SQL-STR
END-EXEC.

EXEC SQL
DECLARE ATTCUR CURSOR FOR STRSQL
END-EXEC.

EXEC SQL
OPEN ATTCUR
END-EXEC.

This is the error I got when compiling:

DSNH312I E DSNHSMUD LINE 2051 COL 36 UNDEFINED OR UNUSABLE
HOST VARIABLE "WS-SQL-STR"
DSNH080I E DSNHSM3D LINE 2051 COL 36 STRING VARIABLE
"WS-SQL-STR" IS NOT "VARCHAR" TYPE

I also tried

EXEC SQL
PREPARE STRSQL FROM :WS-SQL-TXT
END-EXEC.

And got:
DSNH080I E DSNHSM3D LINE 2051 COL 36 STRING VARIABLE
"WS-SQL-TXT" IS NOT "VARCHAR" TYPE

I read somewhere that I need to declare the host variable WS-SQL-STR
within a
EXEC SQL BEGIN DECLARE SECTION END-EXEC and
EXEC SQL END DECLARE SECTION END-EXEC.

but it gave me an error

DSNH084I W DSNHLEXC LINE 831 COL 22 UNACCEPTABLE SQL STATEMENT
DSNH084I W DSNHLEXC LINE 835 COL 22 UNACCEPTABLE SQL STATEMENT

It would be a great help if you can help me in this senario........

Thanks,
Baskaran
Back to top
View user's profile Send private message

muralithirumalaisamy
Warnings : 1

New User


Joined: 13 Jun 2005
Posts: 12
Location: chennai

PostPosted: Wed May 09, 2007 3:24 pm    Post subject: Re: DSNH080I-error: UNACCEPTABLE SQL STATEMENT
Reply with quote

Hi Baskar,

In ur Move statemnt

MOVE WS-SQL TO WS-SQL-TXT.


But u have declared a varchar variable WS-SQL-STR. under that only u have WS-SQL-TXT. Since WS-SQL-STR is a varchar variable u should use the move stmt as

MOVE WS-SQL TO WS-SQL-STR.

Thanks
Murali
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 -> ABENDS & Debugging All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm


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