If you are using DSNTEP2/4 with SQLFORMAT = SQL, are filtered out. You need to use either SQLPL or SQLCOMNT - either via a PARM or --#SET.
DSNTIAD passes through to Db2. The same for DSNTIAUL - but who would use that to create a stored procedure? This is usefull commenting other pieces of SQL that's are run using them - when -- comments are rejected.
Or, you could have localised version of any of these to do whatever you want - their source code is in SDSNSAMP.
James Campbell
On 20 Nov 2023 at 6:45, Peter Vanroose via Internatio wrote:
> "--" comments are stripped by the client, Db2 never even sees them, so they cannot end up in the catalog.
>
>
> If you embed comments in they will appear in the catalog.
>
>
> ------------------------------
> Peter Vanroose
> ABIS Training & Consulting
> ------------------------------
> -------------------------------------------
> Original Message:
> Sent: Nov 19, 2023 07:35 AM
> From: Shay Miller
> Subject: Comments in procedure body
>
>
> Hello Everyone.
>
> We are in the process of implementing stored procedures with dynamic result sets on a wide scale.
>
> We treat them like we treat cobol programs - they are to be maintained and written by the apllication teams.
>
> The life cycle of the defintions is:
>
> The programmer creates the procedure in a special schema in the test system.
> The DA/DBA teams generates the definition from the catalog and create the procedure in QA/PROD/training systems.
>
>
> One of our programmers said that the comments he wrote in his procedure (legitimate action) disappear in higher environments.
>
> I've checked and indeed the comments are stripped and not stored in the catalog (TEXT field in SYSIBM.SYSROUTINES).
>
> I think that his request to save the comments is logical and reasonable.
>
>
>
> Is there a way to not strip the comments and have them saved in the catalog?
>
> We are on DB2 12 LVL 100 on z (not LUW).
>
>
>
> Thank you,
>
> Shay.
>
>
>
> ------------------------------
> ShayMillerMataf
> ------------------------------
>
>
Original Message:
Sent: 11/20/2023 1:45:00 AM
From: Peter Vanroose
Subject: RE: Comments in procedure body
"--" comments are stripped by the client, Db2 never even sees them, so they cannot end up in the catalog.
If you embed comments in /* comment here */ they will appear in the catalog.
------------------------------
Peter Vanroose
ABIS Training & Consulting
https://www.abis.be/html/enDB2Calendar.html
------------------------------
Original Message:
Sent: Nov 19, 2023 07:35 AM
From: Shay Miller
Subject: Comments in procedure body
Hello Everyone.
We are in the process of implementing stored procedures with dynamic result sets on a wide scale.
We treat them like we treat cobol programs - they are to be maintained and written by the apllication teams.
The life cycle of the defintions is:
- The programmer creates the procedure in a special schema in the test system.
- The DA/DBA teams generates the definition from the catalog and create the procedure in QA/PROD/training systems.
One of our programmers said that the comments he wrote in his procedure (legitimate action) disappear in higher environments.
I've checked and indeed the comments are stripped and not stored in the catalog (TEXT field in SYSIBM.SYSROUTINES).
I think that his request to save the comments is logical and reasonable.
Is there a way to not strip the comments and have them saved in the catalog?
We are on DB2 12 LVL 100 on z (not LUW).
Thank you,
Shay.
------------------------------
ShayMillerMataf
------------------------------