Endevor written Db2/SQL Stored Procedure(STP) wrapped when viewed in IBM Data Studio
search cancel

Endevor written Db2/SQL Stored Procedure(STP) wrapped when viewed in IBM Data Studio

book

Article ID: 200138

calendar_today

Updated On:

Products

Endevor

Issue/Introduction

It appears that when a Db2/SQL Stored Procedure was created in Db2 via Endevor, the carriage control is lost 

Resolution

The problem occurs when an element is moved  - the processor retrieves the element to a PDSE (which is readable after the retrieve), then a step executes DSNTEP2 - where the Stored Procedure (ELEMENT) is copied into the Db2 System catalog...this is where the copy is not using CRLF. It was found that there are different options that can be set in DSNTEP2 for SQL Stored Procedures:

SQLFORMAT
Specifies how DSNTEP2 or DSNTEP4 pre-processes SQL statements before passing them to Db2. Select one of the following options:

SQL
This is the preferred mode for SQL statements other than SQL procedural language. When you use this option, which is the default, DSNTEP2 or DSNTEP4 collapses each line of an SQL statement into a single line before passing the statement to Db2. DSNTEP2 or DSNTEP4 also discards all SQL comments.


SQLCOMNT
This mode is suitable for all SQL, but it is intended primarily for SQL procedural language processing. When this option is in effect, the behavior is similar to SQL mode, except that DSNTEP2 or DSNTEP4 does not discard SQL comments. Instead, it automatically terminates each SQL comment with a line feed character (hex 25), unless the comment is already terminated by one or more line formatting characters. Use this option to process SQL procedural language with minimal modification by DSNTEP2 or DSNTEP4.


SQLPL
This mode is suitable for all SQL, but it is intended primarily for SQL procedural language processing. When this option is in effect, DSNTEP2 or DSNTEP4 retains SQL comments and terminates each line of an SQL statement with a line feed character (hex 25) before passing the statement to Db2. Lines that end with a split token are not terminated with a line feed character. Use this mode to obtain improved diagnostics and debugging of SQL procedural language.