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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 236

PostPosted: Thu Jul 08, 2010 5:45 pm    Post subject: How to add an input parameter to an SP using Alter Procedure
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    Post subject:
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: 236

PostPosted: Thu Jul 08, 2010 6:24 pm    Post subject:
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: 236

PostPosted: Fri Jul 09, 2010 8:22 am    Post subject: Reply to: How to add an input parameter to an SP using Alter
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    Post subject:
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    Post subject: Re: Reply to: How to add an input parameter to an SP using A
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: 236

PostPosted: Fri Jul 09, 2010 2:09 pm    Post subject:
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: 236

PostPosted: Fri Jul 09, 2010 2:11 pm    Post subject:
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    Post subject:
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: 236

PostPosted: Fri Jul 09, 2010 2:40 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Formating the Input file sreekusr DFSORT/ICETOOL 3 Fri Feb 17, 2017 10:40 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
No new posts Can DFSPARM override SORTKEYS paramet... ashek15 DB2 2 Tue Jan 31, 2017 11:36 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts DDNAME parameter mistah kurtz JCL & VSAM 6 Mon Dec 19, 2016 4:41 pm


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