Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MCH3401 CALLP

904 views
Skip to first unread message

larry_...@hotmail.com

unread,
Jul 10, 2013, 4:00:11 PM7/10/13
to
I am trying to use more /free code, and I am trouble replacing a simple "CALL".
And by simple, I mean not even passing any parmeters...

Let me start by saying I have 2 RPGLE programs; PROGM1 calls PROGM2. From a command line I can "CALL PROGM1" and "CALL PROGM2". Both work fine...

When I change PROGM1, to call PROGM2: in fixed format:

C CALL 'PROGM2'

There is no error....

When I change it to free format:

* PROGRAM PROGM1
D PGM02 PR EXTPGM('PROGM2')

// YES.. THE PROGRAM NAME IS UPPER CASE..

/FREE
CALLP PGM02 ();
/END-FREE




* PROGRAM PGM02
D PROGM2 PR EXTPGM('PROGM2')

// YES IT IS UPPER CASE..

D PROGM2 PI (I have try with and without this line.)

/FREE

/END-FREE

What ever I try PROGM1, and try to goto PROGM2, I always get:

CANNOT RESOLVE TO OBJECT PROGM2. TYPE AND SUBTYPE X'0201' AUTHORITY
X'0000'.

jse...@yahoo.co.nz

unread,
Jul 10, 2013, 5:38:11 PM7/10/13
to
On Thursday, July 11, 2013 8:00:11 AM UTC+12, larry_...@hotmail.com wrote:
<snip>

I'm confused by your code posting.

> When I change it to free format:
>
> * PROGRAM PROGM1
> D PGM02 PR EXTPGM('PROGM2')
>
> // YES.. THE PROGRAM NAME IS UPPER CASE..
>
> /FREE
> CALLP PGM02 ();
> /END-FREE
>
The above looks OK, you've defined a prototype called PGM02 which defines the external program PROGM2 so you can use it in a CALLP statement as you have done.

> * PROGRAM PGM02
> D PROGM2 PR EXTPGM('PROGM2')

I assume this is the source of your other program, PROGM2? Why are you using the EXTPGM spec? If this is the prototype for PROGM2 in the PROGM2 source, it's not an external program. I'm confused...

>
> // YES IT IS UPPER CASE..
>
> D PROGM2 PI (I have try with and without this line.)

This would imply this is the source for PROGM2 and you are defining the parameters (of which there are none). Just more confusion about the EXTPGM keyword used previously.

>
> /FREE
>
> /END-FREE
>
> What ever I try PROGM1, and try to goto PROGM2, I always get:

GOTO PROGM2??? You can call a program but you goto a label in your program. This implies PROGM2 isn't an external program at all but a label in your program.

>
> CANNOT RESOLVE TO OBJECT PROGM2. TYPE AND SUBTYPE X'0201' AUTHORITY
> X'0000'.

My suspicion is the EXTPGM reference but I am a bit confused by your code snippets and description.

larry_...@hotmail.com

unread,
Jul 11, 2013, 8:17:27 AM7/11/13
to

Yes... I'am confused too...

For PROGM2 I deleted the P PR EXTPGM(PROGM2) and the P PI lines.

Still get the same error....

> What ever I try PROGM1, and try to goto PROGM2, I always get:
GOTO PROGM2???

Meaning that " CALLP PGM02 ".

This has got to be something stupid...

larry_...@hotmail.com

unread,
Jul 11, 2013, 9:05:53 AM7/11/13
to
Here is my code:


A DSPSIZ(24 80 *DS3)
A CF03
A R HPD0DF1
A CF06
A CF07
A 1 70'HPD0DF1 '
A COLOR(TRQ)
A 10 4'FIRST NAME.........:'
A COLOR(RED)
A FSTNAM 40A B 10 25
A 23 2'CMD3: EXIT'
A COLOR(YLW)
A 23 36'CMD6: CALLP HPD0E'
A COLOR(YLW)
A 23 60'CMD7: CALL HPD0E'
A COLOR(YLW)

0001.00
0002.00 ********************************************************************
0003.00 FHPD0DS CF E WORKSTN
0004.00 ********************************************************************
0005.00 **
0006.00 D HPD0E PR EXTPGM('HDP0E')
0007.00 ***************************************************************
0008.00 /free
0009.00 //
0010.00 DOU *INLR = *ON;
0011.00 //
0012.00 EXFMT HPD0DF1;
0013.00 //
0014.00 // CF3 - EXIT
0015.00 IF *INKC = *ON;
0016.00 EVAL *INLR = *ON;
0017.00 RETURN;
0018.00 ENDIF ;
0019.00 //
0020.00 // CF6 - THIS DOES NOT WORK
0021.00 IF *INKF = *ON ;
0022.00 CALLP HPD0E ();
0023.00 ENDIF ;
0024.00 /end-free
0025.00 *
0026.00 * CF7 - THIS WORKS
0027.00 C IF *INKG = *ON
0028.00 C CALL 'HPD0E'
0029.00 C Endif
0030.00 /free
0031.00 //
0032.00 ENDDO ;
0033.00 /end-free


A DSPSIZ(24 80 *DS3)
A CF03
A*
A R HPD0EF1
A 1 70'HPD0EF1 '
A COLOR(TRQ)
A 10 4'LAST NAME.........:'
A COLOR(RED)
A LSTNAM 40A B 10 25
A 23 2'CMD3: EXIT'
A COLOR(YLW)

0001.00
0002.00
0003.00 FHPD0ES CF E WORKSTN
0004.00 *************************************
0005.00 **
0006.00 /free
0007.00 //
0008.00 DOU *INLR = *ON;
0009.00 //
0010.00 EXFMT HPD0EF1;
0011.00 //
0012.00 // CF3 EXIT
0013.00 IF *INKC = *ON;
0014.00 EVAL *INLR = *ON;
0015.00 RETURN;
0016.00 ENDIF ;
0017.00 //
0018.00 ENDDO ;
0019.00 /end-free

CRPence

unread,
Jul 11, 2013, 2:18:17 PM7/11/13
to
On 10 Jul 2013 13:00, larry_...@hotmail.com wrote:
> I am trying to use more /free code, and I am trouble replacing a
> simple "CALL".
> And by simple, I mean not even passing any parameters.
>
> Let me start by saying I have 2 RPGLE programs; PROGM1 calls PROGM2.
> From a command line I can "CALL PROGM1" and "CALL PROGM2". Both work
> fine.
>
> <<SNIP example code>>

Nothing obviously wrong. Note that the use of "CALLP PGM02();" and
use of "PGM02();" should be synonymous; i.e. the CALLP is optional.

> ... I always get:
>
> "CANNOT RESOLVE TO OBJECT PROGM2. TYPE AND SUBTYPE X'0201' AUTHORITY
> X'0000'."

The MCH3401 text is in all uppercase? What release, installed
primary language, and job CCSID?

With the job running with LOG(4 0 *SECLVL), gather the spooled joblog
with DSPJOBLOG OUTPUT(*PRINT) and post all data from the request message
showing the CALL PGM01 up to and including the DSPJOBLOG request message.

p.s. I will respond to the actual code posting which will presumably
nullify this request. But I post this anyhow, to emphasize how
important it is not to utilize munged or hypothetical examples to
describe an actual problem. Better to pare down the problem and get an
actual re-create, and then present the *actual* scenario.

--
Regards, Chuck

CRPence

unread,
Jul 11, 2013, 2:31:24 PM7/11/13
to
On 11 Jul 2013 06:05, larry_...@hotmail.com wrote:
> Here is my code:
>
> <<SNIP most of DSPF DDS>>
> A 23 36'CMD6: CALLP HPD0E'
> A COLOR(YLW)
> A 23 60'CMD7: CALL HPD0E'
> A COLOR(YLW)
>
> 0001.00
> 0002.00 *********************************************************
> 0003.00 FHPD0DS CF E WORKSTN
> 0004.00 *********************************************************
> 0005.00 **
> 0006.00 D HPD0E PR EXTPGM('HDP0E')
> 0007.00 *********************************************************
> 0008.00 /free
> <<SNIP>>
> 0020.00 // CF6 - THIS DOES NOT WORK
> 0021.00 IF *INKF = *ON ;
> 0022.00 CALLP HPD0E ();
> 0023.00 ENDIF ;
> 0024.00 /end-free
> 0025.00 *
> 0026.00 * CF7 - THIS WORKS
> 0027.00 C IF *INKG = *ON
> 0028.00 C CALL 'HPD0E'
> 0029.00 C Endif
> <<SNIP remainder of RPG source and other DSPF and RPG source>>

FWiW the actual program names, for example in the CRTxxx request that
compiles the RPG sources would have been very worthwhile to better
describe the problem.

Presumably the first program was created with the name HPD0D and the
second was created with the name HPD0E.

Presumably the error seen in the joblog was MCH3401 "Cannot resolve
to object HDP0E. Type and Subtype X'0201' Authority X'0000'." Copy and
paste the object name from the message, between the double quotes for
the following request, to see that no programs are presented:
WRKPGM *LIBL/"" /* i.e. issue WRKPGM *LIBL/"HDP0E" */

A subtle difference should be conspicuous, between the name of the
object that can not be resolved [aka found or located] and the name of
the program that is supposed to be called according to the text in the
display file *and* the name referenced in the fixed-format CALL. The
RPG called the program named on the EXTPGM(), just as coded, and the
run-time properly identified that no such program name existed in the
*LIBL of the job. Correct the literal on the EXTPGM() specification,
recompile the program from that modified RPG source, and the problem
should be resolved.

--
Regards, Chuck

Ken Sims

unread,
Jul 11, 2013, 4:31:19 PM7/11/13
to
Hi Larry -

On Thu, 11 Jul 2013 06:05:53 -0700 (PDT), larry_...@hotmail.com
wrote:

>0006.00 D HPD0E PR EXTPGM('HDP0E')
Here the program is called HDP0E.

>0028.00 C CALL 'HPD0E'
Here the program is called HPD0E.

'HDP0E' <> 'HPD0E'

--
Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.

jse...@yahoo.co.nz

unread,
Jul 11, 2013, 7:52:56 PM7/11/13
to
On Friday, July 12, 2013 1:05:53 AM UTC+12, larry_...@hotmail.com wrote:
> Here is my code:
<snip>

> A 23 36'CMD6: CALLP HPD0E'
> A COLOR(YLW)
> A 23 60'CMD7: CALL HPD0E'
> A COLOR(YLW)

From the above lines, it looks like you have created a program called HPD0E.

<snip>
> 0006.00 D HPD0E PR EXTPGM('HDP0E')
> 0007.00 ***************************************************************

Here, you have created a prototype called HPD0E which you are saying refers to a program called HDP0E which exists as a seperate program on disk. This means, that although you use HPD0E on your CALLP statement, it will actually try to call a program called HDP0E.

<snip>

> 0020.00 // CF6 - THIS DOES NOT WORK
> 0021.00 IF *INKF = *ON ;
> 0022.00 CALLP HPD0E ();
> 0023.00 ENDIF ;
> 0024.00 /end-free

As previously noted, the prototype above has defined HPD0E as calling the external program HDP0E. My guess is this is a typo and HDP0E doesn't exist?

> 0025.00 *
> 0026.00 * CF7 - THIS WORKS
> 0027.00 C IF *INKG = *ON
> 0028.00 C CALL 'HPD0E'
> 0029.00 C Endif
> 0030.00 /free
> 0031.00 //
> 0032.00 ENDDO ;
> 0033.00 /end-free

No doubt this works because you are directly calling HPD0E which is the correct name.

larry_...@hotmail.com

unread,
Jul 15, 2013, 7:50:34 AM7/15/13
to
That was it.... The typo and correcting the PR PI...

Thanks to all....
0 new messages