×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I'm working in a JDE World shop, and while trying to use subprocedures in
RPGIV report programs in the JDE environment, we have discovered a problem
that has proved challenging.
Here is a very simplistic example:
DDS for the printer file PRTF (note that field VTX001 is defined with two
different lengths on two different record formats):
R DETAIL1
VTX001 10A 10 1
R $HEADNG1
VTX001 20A 10 1
If I compile the program below with CRTBNDRPG PGM(MYLIB/PGM1)
SRCFILE(MYLIB/JDESRCLE),
it compiles with no errors...
Source code for RPGLE program PGM1:
FPRTF O E printer
/free
write DETAIL1;
*inlr = *on;
/end-free
However, if I have a subprocedure defined in my program, I get an error on
the compile.
Source code for PGM2:
FPRTF O E printer
*----------------------------------------------------------
* Prototype for call for GetJulDate
*
D GetJulDate PR 6S 0
D pYYMMDD 8 OPTIONS(*NOPASS) CONST
D pFFMT 10 OPTIONS(*NOPASS) CONST
*----------------------------------------------------------
*
/free
write DETAIL1;
*inlr = *on;
/end-free
*
*----------------------------------------------------------
P GetJulDate B
D GetJulDate PI 6S 0
D pInDate 8 OPTIONS(*NOPASS) CONST
D pFrmFmt 10 OPTIONS(*NOPASS) CONST
* Locally defined vars
*
D dToday S D inz(*sys)
D fDate S 8
/FREE
Return 1;
/END-FREE
P GetJulDate E
If I compile THIS program with CRTBNDRPG PGM(MYLIB/PGM2)
SRCFILE(MYLIB/JDESRCLE) DFTACTGRP(*NO) ACTGRP(*CALLER), I get the following
error on the compile:
16=ODETAIL1
*---------------------------------------------------------------------------
* RPG record format . . . . : DETAIL1
* External format . . . . . : DETAIL1 : MYLIB/PRTF
*---------------------------------------------------------------------------
17=O VTX001 10A CHAR 10
18=O$HEADNG1
*---------------------------------------------------------------------------
* RPG record format . . . . : $HEADNG1
* External format . . . . . : $HEADNG1 : MYLIB/PRTF
*---------------------------------------------------------------------------
19=O VTX001 20A CHAR 20
======> aaaaa
*RNF6033 30 a 000002 Length of externally-described field is not the
same as a
prior definition; specification is ignored.
I don't need or want a philosophical argument about WHY I need to do this...
THIS is the just way that JDE does things.
What I do want to know is wow do I get around this problem?
Regards,
Steve
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.