Thanks Rob,
I did take into account what you said but for us that did not seem to be a problem. We have our own utility that recompiles all programs using the old record format identifier of the file modified. So we would recompile in the example given.
There's a hitch, though. Our utility wouldn't be able to detect that the program should be recompiled because it depends upon DSPPGMREF. I thought that EXTNAME on the DS would have shown in the DSPPGMREF but I was wrong.
In your example I understand that no modification or compilation would be necessary.
Thanks.
-----Message d'origine-----
De : midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de rob@xxxxxxxxx
Envoyé : mardi 4 mars 2008 14:01
À : Midrange Systems Technical Discussion
Objet : RE: DSPPGMREF and SQLRPG
David,
You blew by the rest of my explanation and ignored it.
Let's say you did have
d myfileds ds extname(myfile) qualified
exec sql select * into :myfileds from myfile where TheKey = :selection;
Now your file layout changes (new field at end) but the program is not recompiled. Many releases ago the program would still work with just a minor warning error in the joblog. Now it's a hard halt.
Instead I recommend
d myfileds ds extname(myfile) qualified
exec sql select iNeedThis, iNeedThat into :myfileds.thisField, :myfileds.thatField from myfile where TheKey = :selection;
Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
David FOXWELL <David.FOXWELL@xxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
03/04/2008 05:20 AM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
To
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> cc
Subject
RE: DSPPGMREF and SQLRPG
Joe wrote :
<A drawback to dynamic SQL (your second example) is that during impact analysis you really have no way to track which programs are using a given table.>
Mark wrote :
<This is precisely why you need to do "impact analysis" at the field level.>
Rob wrote :
<IBM has discouraged the use of 'select * into :myds'>
I think this example would be difficult to treat, if RS were hardcoded.
'SELECT * FROM ' + filename;
EXEC SQL
FETCH C1 INTO : RS;
Wouldn't it be a simple rule to at least impose that if 'SELECT *' were used then RS must be declared with 'DS EXTNAME' or 'LIKEREC'?
If so, would there be a preference to using one or the other?
IF 'SELECT *' were never used, then there's no problem if "impact analysis" is at the field level. Right?
Finally,
Eric wrote :
<This is one reason to avoid dynamically prepared sql.>
I have to take this into account. I've discovered that one of our services relies totally on DSPPGMREF using the record identifier when a file is modified. They have strict programming rules so that this covers all the possibilties. This could prevent the rest of us from using dynamically prepared sql.
--
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.
As an Amazon Associate we earn from qualifying purchases.