Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling SQL error codes #283

Merged
merged 4 commits into from
Oct 29, 2022
Merged

Conversation

vargajb
Copy link
Contributor

@vargajb vargajb commented Oct 25, 2022

Signed-off-by: Janos Varga 113785741+vargajb@users.noreply.github.com

Proposed changes

Handling SQL error codes after the SQL statements.
If I compile the program without bind, the error message looks like this:

ERROR AT OPEN CUR1
 DSNT408I SQLCODE = -805, ERROR:  PACKAGE NAME DALLASC..CBLDB21.1B89E5800200F25A NOT FOUND IN PLAN Z91361. REASON 03
 DSNT418I SQLSTATE   = 51002 SQLSTATE RETURN CODE
 DSNT415I SQLERRP    = DSNXEPM SQL PROCEDURE DETECTING ERROR
 DSNT416I SQLERRD    = -251  0  0  -1  0  0 SQL DIAGNOSTIC INFORMATION
 DSNT416I SQLERRD    = X'FFFFFF05'  X'00000000'  X'00000000'  X'FFFFFFFF'  X'00000000'  X'00000000' SQL DIAGNOSTIC INFORMATION

If this modification is appropriate, I will also include SQL error handling in the other programs (CBLDB22.cbl and CBLDB23.cbl).

Fixes # (issue)

Type of change

What type of changes does your PR introduce to the COBOL Programming Course? Put an x in the boxes that apply.

  • Bug fix (change which fixes one or more issues)
  • New feature (change which adds functionality or features to the course)
  • Translations (change which adds or modifies translations of the course)
  • Documentation (change which modifies documentation related to the course)
  • This change requires an update to the course's z/OS environment

Checklist:

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This checklist will be used as reference for both the contributor and the reviewer

  • I have read the Contributing Guideline
  • I have included a title and description for this PR
  • I have DCO-signed all of my commits that are included in this PR
  • I have tested it manually and there are no regressions found
  • I have commented my code, particularly in hard-to-understand areas (if appropriate)
  • I have made corresponding changes to the documentation (if appropriate)

Signed-off-by: Janos Varga <113785741+vargajb@users.noreply.github.com>
@tanto259
Copy link
Member

Looks good to me! If you can add the error handling code to the CBLDB22 and CBLDB23, that will be great :)

@tanto259 tanto259 added the enhancement New feature or request label Oct 27, 2022
Signed-off-by: Janos Varga <113785741+vargajb@users.noreply.github.com>
In the documentation, I did not find that this file definition was intentionally missing from the job.

Signed-off-by: Janos Varga <113785741+vargajb@users.noreply.github.com>
Signed-off-by: Janos Varga <113785741+vargajb@users.noreply.github.com>
@vargajb
Copy link
Contributor Author

vargajb commented Oct 27, 2022

@tanto259

  • I added the SQL error handling to the COBOL sources CBLDB22 and CBLDB23.
  • I inserted the missing DD REPORT in CBLDB22R.jcl. In the documentation, I did not find that this file definition was intentionally missing from the job.

Copy link
Member

@tanto259 tanto259 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch on the REPORT DD statement missing there.

Thanks, @vargajb!

@tanto259 tanto259 merged commit a2087a4 into openmainframeproject:master Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants