I have this programme in RPGLE (a summary)
d WkCd0001 s 3a
d WkCd0002 s 3a
d WkDe0001 s 50a
D STARTPGM1 PR
D P_PARM LIKE (P_PARM)
*
D STARTPGM1 PI
D P_PARM 5000
*
D DsQuery1 DS
D Field_1 1 10 Inz(*Blanks)
D Field_2 11 50 Inz(*Blanks)
D Field_3 51 101 Inz(*Blanks)
c ExSr SrRout01
c ExSr SrStart
/free
BegSr SrRout01;
EVAL DsQuery1 = P_PARM;
Eval WkCd0001 = %Trim(Field_1);
Eval WkCd0002 = %Trim(Field_2);
Eval WkDe0001 = %Trim(Field_3);
with a simple interactive call, passing these 3 parameters:
CALL PGM(MYLIBL/STARTPGM1) PARM(“TXT” '$$$“ 'NOT FOUND”) and when debugging
the third parameter (WKDEELEM) gives me this result
WKDEELEM = “NOT FOUND ?? ”
that is, it also returns these two characters (??) in addition to ‘NOT FOUND’.
I would like to obtain only the following result:
WkCd0001 = “TXT”
WKCd0002 = '$$$'
WkDe0001 = “NOT FOUND ”
How can I correct the code?
d WkCd0001 s 3a
d WkCd0002 s 3a
d WkDe0001 s 50a
D STARTPGM1 PR
D P_PARM LIKE (P_PARM)
*
D STARTPGM1 PI
D P_PARM 5000
*
D DsQuery1 DS
D Field_1 1 10 Inz(*Blanks)
D Field_2 11 50 Inz(*Blanks)
D Field_3 51 101 Inz(*Blanks)
c ExSr SrRout01
c ExSr SrStart
/free
BegSr SrRout01;
EVAL DsQuery1 = P_PARM;
Eval WkCd0001 = %Trim(Field_1);
Eval WkCd0002 = %Trim(Field_2);
Eval WkDe0001 = %Trim(Field_3);
with a simple interactive call, passing these 3 parameters:
CALL PGM(MYLIBL/STARTPGM1) PARM(“TXT” '$$$“ 'NOT FOUND”) and when debugging
the third parameter (WKDEELEM) gives me this result
WKDEELEM = “NOT FOUND ?? ”
that is, it also returns these two characters (??) in addition to ‘NOT FOUND’.
I would like to obtain only the following result:
WkCd0001 = “TXT”
WKCd0002 = '$$$'
WkDe0001 = “NOT FOUND ”
How can I correct the code?




Comment