IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SCALAR FUNCTION not compiling


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
komal

New User


Joined: 09 May 2005
Posts: 17

PostPosted: Fri Mar 21, 2008 1:02 pm
Reply with quote

Hi All,
My COBOL+DB2 program is not getting compiled when i am trying to use SQL Scalar function REPLACE in my application program. Please find the sample SQL Query below

SELECT REPLACE(LTRIM(RTRIM(:xyz)),',','') into :xxx
FROM SYSIBM.SYSDUMMY1;

Where XYZ and XXX are the host variables declared as follows in my application program

01 XYZ PIC X(30) value ' 2,222,222.22'.
01 XXX PIC X(30) value spaces.

When i am trying to compile my program the SQL statement is not getting commented out and equalent call statement is not getting generated.

it is gving the following error message
1. EXEC is not a cobol key word
2. SQL is not a cobol key word
3. END-EXEC is not a cobol key word


can any one let me know what is the issue

Thanks

Kiran
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Fri Mar 21, 2008 2:22 pm
Reply with quote

Please use correct JCL to compile COBOL + DB2 program. I guess what JCL you have used is for compiling COBOL programs only.

Ask your peers for JCL.
Back to top
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Fri Mar 21, 2008 3:10 pm
Reply with quote

i think you not are doing a proper pre-compilation on your program. as the pre-compiler will convert all the EXEC SQL......END-EXEC statements into COBOL CALL statements. in that case there is no chance of getting the error message stated by you.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
No new posts INSYNC option with same function as I... JCL & VSAM 0
Search our Forums:

Back to Top