If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 Function on z\OS

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-05, 05:33
sathish_T sathish_T is offline
Registered User
 
Join Date: Feb 2005
Posts: 7
Red face DB2 Function on z\OS

Hi ,

I have the some DB2 function working fine in AIX. I have to deploy that in z\OS. I am facing Problems in that Atomic, SET, Declare , IF .. is not valid statement )

For Eg:

CREATE FUNCTION CONVPB.CONVERTX (
LEN_CHAR VARCHAR(765),
NUM_EXP Decimal(15,9)
RETURNS VARCHAR(765)
BEGIN ATOMIC
DECLARE REXP VARCHAR(765);
DECLARE LEN INTEGER;
DECLARE C_TYPE CHAR(1);
SET LEN = ORA8.TO_NUMBER(ORA_SUBSTR(LEN_CHAR,2));
SET C_TYPE = ORA_SUBSTR(LEN_CHAR, 1, 1);
IF (C_TYPE = 'v') THEN
SET REXP = ORA_SUBSTR(CHAR(NUM_EXP), 1, LEN);
ELSE
SET REXP = ORA_RPAD(CHAR(NUM_EXP),LEN);
END IF;
RETURN REXP;
END;


When I try to create this from Spufi or from DB2 Devlwopmwnt center . it is giving me the following error : I hope Atomic, If, Else , Declare statements are not supported in z\OS DB2 functions. Can any one tell me the alternative for this .

Erorr #1 :
DSNT408I SQLCODE = -104, ERROR: ILLEGAL SYMBOL "ATOMIC". SOME SYMBOLS THAT
MIGHT BE LEGAL ARE: ON <INTEGER>

FYI : According to my project functionality I should not change that to DB2 SQL stored Procedure.

Waiting for your suggestions on this.

Warm Regards,
Sathish.T
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On