× 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.



Hey guys, I've come across something that I can't explain. I'm working on updating an old RPG/36 program to more modern techniques. The first thing I did was to change the screen to be externally defined. Among the many fields on this screen is one called WOSTAT which is defined thus (this is from the compile listing so that I would be sure that I wasn't getting confused):

WOSTAT 2A O 4 47

This same field is in the program in the I specs of one the program described files. The I specs from the program look like this:

I 2 3 0WOSTAT 25

Notice that the data types don't match. The weird part is that this compile of the program completed successfully!! A look at the compile listing for the program shows this:

WOSTAT P(2,0) 814D 2821 2850 3592

A little more investigation shows that the record format of the screen file that contains the WOSTAT definition above isn't included in the output specs of the compile listing. So that explains why the compile succeeded. I don't reference that record format anywhere in the program. That is probably why it is missing from the compile listing of the program (though it seems odd to me to omit it).

But then it gets weird. I added a little procedure at the bottom of this program (after all the O specs, which is where procedures should go, right? I've done this before, so that's one reason I'm surprised at what happened next). The procedure I added appears before the compile-time arrays (remember, this is old-school code here). The procedure I added does not reference the record format in question, nor does it reference the field WOSTAT. But now the compile fails! Now the record format is copied into the program (even though it still isn't referenced). Does putting a procedure body at the bottom of a program change the way the compiler includes/ignores externally defined fields/formats? I admit that I need to change the screen specs, but why did the behaviour of the compiler change when I coded the procedure?

James Rich

"As for security, being lectured by Microsoft is like receiving wise words on the subject of compassion from Stalin."
-- mormop on lwn.net



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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

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.