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

How to add an input parameter to an SP using Alter Procedure


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

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Thu Jul 08, 2010 5:45 pm
Reply with quote

Dear All,

Please correct the alter command shown below i am getting SQLCODE=-199 while executing the alter procedure.

ALTER PROCEDURE SPRCT010.SP1
MODIFIES SQL DATA
(IN CNVRSTN_CD CHAR(30) FOR SBCS DATA CCSID EBCDIC ,
IN VAN_ID_CD CHAR(10) FOR SBCS DATA CCSID EBCDIC ,
IN IN_TY_CD CHAR(3) FOR SBCS DATA CCSID EBCDIC ,
OUT OUT_CODE INTEGER )
DYNAMIC RESULT SETS 1
EXTERNAL NAME 'SP1'
LANGUAGE COBOL PARAMETER CCSID EBCDIC PARAMETER STYLE GENERAL
NOT DETERMINISTIC FENCED CALLED ON NULL INPUT MODIFIES SQL DATA
NO DBINFO COLLID CPRCT01C WLM ENVIRONMENT DBAGT212
ASUTIME LIMIT 110000 STAY RESIDENT YES PROGRAM TYPE MAIN
SECURITY DB2 INHERIT SPECIAL REGISTERS
STOP AFTER SYSTEM DEFAULT FAILURES COMMIT ON RETURN YES ?

The purpose of alter is to add an parameter,
IN IN_TY_CD CHAR(3) FOR SBCS DATA CCSID EBCDIC
to the above SP.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 08, 2010 5:55 pm
Reply with quote

IBMMainframes.com Abend Assist wrote:
ILLEGAL USE OF KEYWORD keyword. TOKEN token-list WAS EXPECTED

A syntax error was detected in the statement at the point where the keyword 'keyword' appears. As an aid to the programmer, a partial list of valid tokens is provided in SQLERRM as 'token-list'. This list assumes that the statement is correct up to that point, and only as many tokens are listed as will fit.

Examine the statement in the area of the indicated keyword. A colon or SQL delimiter may be missing.


you have the error messages,
did not bother to give them to us.
can not do anything to help you.
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Thu Jul 08, 2010 6:24 pm
Reply with quote

Correction SQLCODE got is -104 not -199.

Code:

    Rollback done                                                                 
       SQLCODE :    -104                              DSNTIAR CODE :     0                    
                                                                                   
 DSNT408I SQLCODE = -104, ERROR:  ILLEGAL SYMBOL "(". SOME SYMBOLS THAT MIGHT BE
          LEGAL ARE: FENCED EXTERNAL COMMIT PARAMETER RESULT NO DYNAMIC ALLOW   
 DSNT411I SQLCAID    = SQLCAL SQLCA IDENTIFIER                                 
 DSNT418I SQLSTATE   = 42601 SQLSTATE RETURN CODE                               
 DSNT415I SQLERRP    = DSNHPARS SQL PROCEDURE DETECTING ERROR                   
 DSNT416I SQLERRD    = 3  0  3  -1  55  502 SQL DIAGNOSTIC INFORMATION         
 DSNT416I SQLERRD    = X'00000003'  X'00000000'  X'00000003'  X'FFFFFFFF'       
          X'00000037'  X'000001F6' SQL DIAGNOSTIC INFORMATION                   
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Fri Jul 09, 2010 8:22 am
Reply with quote

Any idea regarding syntax issue?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 09, 2010 12:21 pm
Reply with quote

what does your original create procedure look like?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 09, 2010 12:47 pm
Reply with quote

pkmurali wrote:
Any idea regarding syntax issue?


Yes,
the ALTER PROCEDURE seems to only stipulate changes in option list,
not the parameter declaration which only seems to appear in CREATE PROCEDURE

which is what the
'(' is an unacceptable char msg
is all about.
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Fri Jul 09, 2010 2:09 pm
Reply with quote

Dick Brenholtz ,

I want to add one more parameter in my procedure SP1. The Creat Procedure DDL is,

Code:

  SET CURRENT SQLID='GPRCT01B';                                         
  CREATE PROCEDURE SPRCT010.SP1                                   
     (IN CNVRSTN_CD CHAR(30) FOR SBCS DATA CCSID EBCDIC ,               
      IN VAN_ID_CD CHAR(10) FOR SBCS DATA CCSID EBCDIC ,               
      IN IN_TY_CD CHAR(3) FOR SBCS DATA CCSID EBCDIC ,                 
      IN IN_PSTD_DT DATE,                                               
      OUT OUT_CODE INTEGER )                                           
    DYNAMIC RESULT SETS 1                                               
    EXTERNAL NAME 'SP1'                                           
    LANGUAGE COBOL  PARAMETER CCSID EBCDIC  PARAMETER STYLE GENERAL     
    NOT DETERMINISTIC  FENCED  CALLED ON NULL INPUT  MODIFIES SQL DATA 
    NO DBINFO  COLLID CPRCT01C  WLM ENVIRONMENT DBAGT212               
    ASUTIME LIMIT 110000  STAY RESIDENT YES  PROGRAM TYPE MAIN         
    SECURITY DB2  INHERIT SPECIAL REGISTERS                             
    STOP AFTER SYSTEM DEFAULT FAILURES  COMMIT ON RETURN YES ?         

Even after removing the '(' & ')' i am getting SQLCODE=-104
Code:

    Rollback done                                                                 
       SQLCODE :    -104                              DSNTIAR CODE :     0                    
                                                                                   
 DSNT408I SQLCODE = -104, ERROR:  ILLEGAL SYMBOL "CNVRSTN_CD". SOME SYMBOLS THAT
          MIGHT BE LEGAL ARE: <INTEGER> ANY FORMAT ( PREPARE                   
 DSNT411I SQLCAID    = SQLCAL SQLCA IDENTIFIER                                 
 DSNT418I SQLSTATE   = 42601 SQLSTATE RETURN CODE                               
 DSNT415I SQLERRP    = DSNHPARS SQL PROCEDURE DETECTING ERROR                   
 DSNT416I SQLERRD    = 3  0  2  -1  48  502 SQL DIAGNOSTIC INFORMATION         
 DSNT416I SQLERRD    = X'00000003'  X'00000000'  X'00000002'  X'FFFFFFFF'       
          X'00000030'  X'000001F6' SQL DIAGNOSTIC INFORMATION                   
                                                                               

Please let me know how to add a parameter using alter procedure?
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Fri Jul 09, 2010 2:11 pm
Reply with quote

Small correction in previous posting
in create procedure i don't have 'IN_PSDT_DT' field, i have to add the field to the procedure using 'ALter Procedure'.

Thanks
Murali.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 09, 2010 2:17 pm
Reply with quote

I did not see a way to ALTER the PARAMETER DECLARATION,
only the OPTIONS LIST.
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 271

PostPosted: Fri Jul 09, 2010 2:40 pm
Reply with quote

Oh Since ALTER Table helps to add a column for a table i thought ALTEr PROCEDURE will works similar. Thanks Dick Brenholtz.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts DROP & ALTER PARTITION-PBR DB2 0
No new posts force tablespace using LISTDEF input DB2 1
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
Search our Forums:

Back to Top