|
I've had the exact same problem. The $HEADNG1 format (as well as other
formats) are inserted by JDE when the PRTF is compiled through their
tool, Software Version Repository (SVR). These formats are used when you
specify the Dream Writer version should print a cover page and/or a help
page.
The options to print these pages are queried in the RPG program and if
they are set, a call is done to print the pages. There are printer
overrides in effect to share the *PRTF. So even though the original
program may never use $HEADNG1, the called program does. In prior
versions of RPG these unused printer formats where ignored by the
compiler so it was no problem. But now I get the same errors as you
describe. I just use an Ignore($HEADNG1) on the printer file spec.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Stephen Landess
Sent: Friday, August 10, 2007 11:07 AM
To: RPG400-L@xxxxxxxxxxxx
Subject: Feature or Bug?
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
_________________________________________________________________
Now you can see trouble...before he arrives
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_protection_
0507
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.