Re: What is wrong?



OK, new deal:

H*NOMAIN (note that this is commented)
H DEBUG
H DFTACTGRP(*NO) ACTGRP(*CALLER)
H OPTION(*SRCSTMT:*NODEBUGIO)
D DS_EDCJPF E DS EXTNAME(edcjpf)

/copy proto,rtvctl#

P*RTVCTL# B (commented this
run)
D RTVCTL# PI 6S 0
D WO# 6S 0 const
D CTL# 6S 0

C/EXEC SQL
*NB: (I am on V5R4M0 and it refuses one line)
C+ Set Option commit= *none
C/END-EXEC
C/EXEC SQL
C+ Set Option closqlcsr= *endmod
C/END-EXEC

c #main tag
c exsr $rtvctl
C dump
c exsr $rtvstt
C #end TAG
c eval *inlr = *on
C #rtx TAG
c return ctl#

***********************************************
* Retrieve Controlling Workorder
***********************************************
c $rtvctl begsr
C/EXEC SQL
C+ select cjshid
C+ into :ctl#
C+ from edcjlf02
C+ where cjonbr = :wo#
c+ fetch first row only
C/END-EXEC
c #rtvctl# tag
c endsr
*************************************
* Retrieve SQL State
*************************************
c $rtvstt begsr
c #rtvstt tag
c endsr

P*RTVCTL# E (commented this run)

No compile.
main cannot return value

so uncomment all:
rmv actgrp
makes a program

5 QEXCPML QSYS /00A6
RTVCTL# MCNV _QRNP_PEP_RTVCTL#
RTVCTL# MCNV 2100000001 RTVCTL#

break is at #Main and at b of proc no hit
stuck forever

crtrpgmod does not understand sql.


how do I make this a procedure that I can call and call again from a
service program and how do I test it one proc at a time and debug it?



.