A few year ago I created a "Precompiler tool" of sorts that is
automatically called when a program is compiled.
All it does is read the source member and execute a specially formatted
instructions
that are embedded as free text the source (usuallyy in H Specs )
like ADDLIBL, OVRDBF, Create Temp QRY file, call a program, etc.
This way the environment information needed to compile a program is
contained within it's source and does not require the programmer to
remember special instructions.

Samples
^^CMD_B ADDLIBLE QTEMP *FIRST - to run a CMD Before compilation
^^CMD_A ADDLIBLE QTEMP - to run a CMD After compilation
^^CMD_B SNDMSG MSG('Test MSG') TOUSR(GAD) - to send MSG Before
^^CMD_B CALL COFRDCL - to call a program before compilation
etc.
Any CMD is viable.

We also use it to re-create service program after changing and compiling
a module ...

There are also a ^^PGM_B and ^^PGM_A to call a program before / after
compilation

The "Precompiler" tool is called automatically by an Exit Program attached
to
CRTRPGLE, CRTRPGMOD and such commands . so It always run with PDM Op14 .
or manually entering a CRTRPGxxx CMD.

Mr. Bruce Vining helped a lot and advised me how to attach the A/M Exit
Program

Pff, after such a long story, if you find it usefull drop me an email and
I'll look it up
and send you the source.

Gad


.






On Thu, Apr 5, 2012 at 10:48 PM, <midrange-l-request@xxxxxxxxxxxx> wrote:

Send MIDRANGE-L mailing list submissions to
midrange-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.midrange.com/mailman/listinfo/midrange-l
or, via email, send a message with subject or body 'help' to
midrange-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
midrange-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of MIDRANGE-L digest..."


*** NOTE: When replying to this digest message, PLEASE remove all text
unrelated to your reply and change the subject line so it is meaningful.

Today's Topics:

1. Re: Question on updating some OLD programs (rob@xxxxxxxxx)
2. RE: ILE PGM getting authority error when it does have
authority (Monnier, Gary)
3. Fwd: ILE PGM getting authority error when it does have
authority (Jeffrey Tickner)
4. RE: Question on updating some OLD programs (rob@xxxxxxxxx)
5. RE: ILE PGM getting authority error when it does have
authority (rob@xxxxxxxxx)
6. RE: Question on updating some OLD programs (Willie J. Moore)


----------------------------------------------------------------------

message: 1
date: Thu, 5 Apr 2012 15:30:04 -0400
from: rob@xxxxxxxxx
subject: Re: Question on updating some OLD programs

Many people would have to either compile interactively, after manually
typing in a few OVRDBF commands, or, write a 'make' program that compiles
it after setting up the appropriate OVRDBF commands.

As long as your are modernizing you may want to consider abandoning the
cl, if all it does is OVRDBF. I am not saying the presence of CL is bad
but CL just for OVRDBF sake might be. It's not hard to add "user control"
to your Fspec and use QCMDEXC, system, QCAPCMD or your favorite to do the
OVRDBF in the RPG program itself. Then OPEN the file. Doesn't alleviate
your compile concerns but helps on the execution side.

The alternative, and I am also not saying it's 'best practices', I am
simply saying it's an alternative, would be to eschew RPG file operations
and use imbedded sql instead.


Rob Berendt
--
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Victor Hunt <xlcfdp@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>,
Date: 04/05/2012 03:14 PM
Subject: Question on updating some OLD programs
Sent by: midrange-l-bounces@xxxxxxxxxxxx



I do apologize in advance for asking about something most folks dealt with
years and years ago...

I have a large number of programs in our sales reporting system that were
written a very long time ago. We are in the beginning stages of upgrading
them. In most cases, these programs have program defined files. In almost
all cases, the file name is something like SALES. There isn't a file on
our
system called SALES. There are however files called SALES2012, SALES2011,
etc. The CL has an OVRDBF command to point SALES to the appropriate
SALESYYYY file for processing. Of course, this is variable as any
SALESYYYY
file going back 10 years can be selected by the user.

As part of the upgrade, we'd like to change all program defined files to
externally defined files. Unfortunately, the file SALES doesn't exist so
compiles would fail. I could change them all to SALES2012, but at some
point this file won't exist either. I can create an empty file named SALES
with the same layout and no records, but this still has it's problems
(there are many programs where the file is defined more then once, SALES1
and SALES2, for summary processing).

What is the best way to handle this situation? We are on 7.1 by the way if
it makes any difference in how we would handle this.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




------------------------------

message: 2
date: Thu, 5 Apr 2012 19:32:22 +0000
from: "Monnier, Gary" <Gary.Monnier@xxxxxxxxx>
subject: RE: ILE PGM getting authority error when it does have
authority

Good point Rob. I'm too used to *ALLOBJ authority.

Gary Monnier


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:
midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Thursday, April 05, 2012 12:21 PM
To: Midrange Systems Technical Discussion
Subject: Re: ILE PGM getting authority error when it does have authority

Possibly a duplicate object that you are not seeing in the library list?
Do NOT use WRKOBJ! That simply won't show you objects you are not
authorized to. Perform a DSPOBJD instead. That will tell you if you are
not authorized to the first object it finds in the library list.


Rob Berendt
--
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Jeffrey Tickner <jtickner@xxxxxxxxxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxx,
Date: 04/05/2012 03:09 PM
Subject: ILE PGM getting authority error when it does have
authority
Sent by: midrange-l-bounces@xxxxxxxxxxxx




This makes no sense so I'm thinking there is another attribute that is
causing this authority error as a red herring.

There is an ILE program object, 29 modules bound in, that has an owner of
FILEUSER and it adopts *OWNER authority.
It was recently recompiled and now when it goes to update a file it gets a
CPF4269 not authorized to object.
The file it is trying to update is secured by an AUTL that has *PUBLIC
*EXCLUDE and FILEUSER *ALL.
As a test the program object was compiled again in a temporary library,
that library moved to the top of the library list and it works fine with
the same settings.
I'm think there is something different in how the 2 objects were compiled
but I don't have a compile listing anymore for the first program so I
don't know the exact create parms.

Is there any other attribute that can cause an authority error?
They both have the same activation group, QILE.

I searched the archives for CPF4269 and didn't find anything helpful

Jeff Tickner
Arcad Software

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



------------------------------

message: 3
date: Thu, 5 Apr 2012 15:33:12 -0400
from: Jeffrey Tickner <jtickner@xxxxxxxxxxxxxxxxx>
subject: Fwd: ILE PGM getting authority error when it does have
authority

I figured it out from a post on systeminetwork
http://www.systeminetwork.com/forums/aft/61981

the object has embedded SQL and the DYNUSRPRF is wrong.
Apparently you can't get away with compiling *USRPRF and then using CHGPGM
to *OWNER when there is embedded SQL
thanks

Jeff Tickner
Arcad Software





Begin forwarded message:

From: Jeffrey Tickner <jtickner@xxxxxxxxxxxxxxxxx>
Date: April 5, 2012 3:09:28 PM EDT
To: midrange-l@xxxxxxxxxxxx
Subject: ILE PGM getting authority error when it does have authority


This makes no sense so I'm thinking there is another attribute that is
causing this authority error as a red herring.

There is an ILE program object, 29 modules bound in, that has an owner
of FILEUSER and it adopts *OWNER authority.
It was recently recompiled and now when it goes to update a file it gets
a CPF4269 not authorized to object.
The file it is trying to update is secured by an AUTL that has *PUBLIC
*EXCLUDE and FILEUSER *ALL.
As a test the program object was compiled again in a temporary library,
that library moved to the top of the library list and it works fine with
the same settings.
I'm think there is something different in how the 2 objects were
compiled but I don't have a compile listing anymore for the first program
so I don't know the exact create parms.

Is there any other attribute that can cause an authority error?
They both have the same activation group, QILE.

I searched the archives for CPF4269 and didn't find anything helpful

Jeff Tickner
Arcad Software




------------------------------

message: 4
date: Thu, 5 Apr 2012 15:41:21 -0400
from: rob@xxxxxxxxx
subject: RE: Question on updating some OLD programs

I forgot about that one!


Rob Berendt
--
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Alan Shore <ashore@xxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>,
Date: 04/05/2012 03:29 PM
Subject: RE: Question on updating some OLD programs
Sent by: midrange-l-bounces@xxxxxxxxxxxx



In 7.1 there is something called EXTDESC (as well as EXTFILE).
EXTDESC can be used in compiling

Try googling
AS400 EXTFILE EXTDESC
And look at the results here

http://publib.boulder.ibm.com/infocenter/iadthelp/v7r1/index.jsp?topic=/com.ibm.etools.iseries.langref.doc/c0925086322.htm



Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [
mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Victor Hunt
Sent: Thursday, April 05, 2012 3:14 PM
To: Midrange Systems Technical Discussion
Subject: Question on updating some OLD programs

I do apologize in advance for asking about something most folks dealt with
years and years ago...

I have a large number of programs in our sales reporting system that were
written a very long time ago. We are in the beginning stages of upgrading
them. In most cases, these programs have program defined files. In almost
all cases, the file name is something like SALES. There isn't a file on
our system called SALES. There are however files called SALES2012,
SALES2011, etc. The CL has an OVRDBF command to point SALES to the
appropriate SALESYYYY file for processing. Of course, this is variable as
any SALESYYYY file going back 10 years can be selected by the user.

As part of the upgrade, we'd like to change all program defined files to
externally defined files. Unfortunately, the file SALES doesn't exist so
compiles would fail. I could change them all to SALES2012, but at some
point this file won't exist either. I can create an empty file named SALES
with the same layout and no records, but this still has it's problems
(there are many programs where the file is defined more then once, SALES1
and SALES2, for summary processing).

What is the best way to handle this situation? We are on 7.1 by the way if
it makes any difference in how we would handle this.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.


Disclaimer: This message contains confidential information and is intended
only for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please notify the
sender immediately by e-mail if you have received this e-mail by mistake
and delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be intercepted,
corrupted, lost, destroyed, arrive late or incomplete, or contain viruses.
The sender therefore does not accept liability for any errors or omissions
in the contents of this message, which arise as a result of e-mail
transmission. If verification is required please request a hard-copy
version. Any views or opinions presented are solely those of the author
and do not necessarily represent those of the company.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




------------------------------

message: 5
date: Thu, 5 Apr 2012 15:48:25 -0400
from: rob@xxxxxxxxx
subject: RE: ILE PGM getting authority error when it does have
authority

Gary,

I wouldn't use WRKOBJ. Watch this:
CRTPF FILE(ROB/HIDDEN) RCDLEN(10)
GRTOBJAUT OBJ(ROB/HIDDEN) OBJTYPE(*FILE) USER(*PUBLIC) AUT(*EXCLUDE)
CRTUSRPRF USRPRF(DUMMY) USRCLS(*USER) SPCAUT(*NONE)
sign on as dummy
ADDLIBLE LIB(ROB) POSITION(*FIRST)
WRKOBJ OBJ(*LIBL/HIDDEN)
(Cannot find object to match specified name.) This would lead you to
assume that it doesn't exist. However,
DSPOBJD OBJ(*LIBL/HIDDEN) OBJTYPE(*FILE)
CPF2189 - Not authorized to object HIDDEN in ROB type *FILE.

Those of us routinely running under *ALLOBJ forget the trials and
tribulations of those that aren't. As such, our tests are invalid.


Rob Berendt
--
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: "Monnier, Gary" <Gary.Monnier@xxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>,
Date: 04/05/2012 03:29 PM
Subject: RE: ILE PGM getting authority error when it does have
authority
Sent by: midrange-l-bounces@xxxxxxxxxxxx



This may seem an odd question but are you sure the failing program and
file in question are the ones you think they are?

When you do WRKOBJ OBJ(*ALL/programName) OBJTYPE(*PGM) how many copies do
you find?
When you do WRKOBJ OBJ(*ALL/fileName) OBJTYPE(*FILE) how many copies do
you find?

Maybe a library list issue?

Gary Monnier


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [
mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeffrey Tickner
Sent: Thursday, April 05, 2012 12:09 PM
To: midrange-l@xxxxxxxxxxxx
Subject: ILE PGM getting authority error when it does have authority


This makes no sense so I'm thinking there is another attribute that is
causing this authority error as a red herring.

There is an ILE program object, 29 modules bound in, that has an owner of
FILEUSER and it adopts *OWNER authority.
It was recently recompiled and now when it goes to update a file it gets a
CPF4269 not authorized to object.
The file it is trying to update is secured by an AUTL that has *PUBLIC
*EXCLUDE and FILEUSER *ALL.
As a test the program object was compiled again in a temporary library,
that library moved to the top of the library list and it works fine with
the same settings.
I'm think there is something different in how the 2 objects were compiled
but I don't have a compile listing anymore for the first program so I
don't know the exact create parms.

Is there any other attribute that can cause an authority error?
They both have the same activation group, QILE.

I searched the archives for CPF4269 and didn't find anything helpful

Jeff Tickner
Arcad Software

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.




------------------------------

message: 6
date: Thu, 5 Apr 2012 12:47:46 -0700
from: "Willie J. Moore" <WJMoore@xxxxxxxxxxxx>
subject: RE: Question on updating some OLD programs

Why not create a physical file layout (sales) like what is defined in
the program. You could then just compile programs using the sales file.
You could just then do a override to the sales file you want to use in
the CL.
Willie

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Thursday, April 05, 2012 12:41 PM
To: Midrange Systems Technical Discussion
Subject: RE: Question on updating some OLD programs

I forgot about that one!


Rob Berendt
--
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





From: Alan Shore <ashore@xxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>,

Date: 04/05/2012 03:29 PM
Subject: RE: Question on updating some OLD programs
Sent by: midrange-l-bounces@xxxxxxxxxxxx



In 7.1 there is something called EXTDESC (as well as EXTFILE).
EXTDESC can be used in compiling

Try googling
AS400 EXTFILE EXTDESC
And look at the results here
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r1/index.jsp?topic=/
com.ibm.etools.iseries.langref.doc/c0925086322.htm



Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [
mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Victor Hunt
Sent: Thursday, April 05, 2012 3:14 PM
To: Midrange Systems Technical Discussion
Subject: Question on updating some OLD programs

I do apologize in advance for asking about something most folks dealt
with
years and years ago...

I have a large number of programs in our sales reporting system that
were
written a very long time ago. We are in the beginning stages of
upgrading
them. In most cases, these programs have program defined files. In
almost
all cases, the file name is something like SALES. There isn't a file on
our system called SALES. There are however files called SALES2012,
SALES2011, etc. The CL has an OVRDBF command to point SALES to the
appropriate SALESYYYY file for processing. Of course, this is variable
as
any SALESYYYY file going back 10 years can be selected by the user.

As part of the upgrade, we'd like to change all program defined files to

externally defined files. Unfortunately, the file SALES doesn't exist so

compiles would fail. I could change them all to SALES2012, but at some
point this file won't exist either. I can create an empty file named
SALES
with the same layout and no records, but this still has it's problems
(there are many programs where the file is defined more then once,
SALES1
and SALES2, for summary processing).

What is the best way to handle this situation? We are on 7.1 by the way
if
it makes any difference in how we would handle this.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.


Disclaimer: This message contains confidential information and is
intended
only for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please notify
the
sender immediately by e-mail if you have received this e-mail by mistake

and delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be
intercepted,
corrupted, lost, destroyed, arrive late or incomplete, or contain
viruses.
The sender therefore does not accept liability for any errors or
omissions
in the contents of this message, which arise as a result of e-mail
transmission. If verification is required please request a hard-copy
version. Any views or opinions presented are solely those of the author
and do not necessarily represent those of the company.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



------------------------------

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) digest list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



End of MIDRANGE-L Digest, Vol 11, Issue 524
*******************************************


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].