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



Joe,

One thing I do expect to work, is how Jon Paris describes it to me. Most of the time. Especially when it's published. <grin>

I get what you are saying, seems kind of "chicken/egg" thing. Or maybe what the compiler sees first. Is it bottom up? All at the same time? I would think that it would be top down, and therefore they all should work.

My real big question is: is it my code, or the compiler, or the set of PTF/TRs that I have issues with?

I'm willing to wait on my people to upgrade the system, but it may be a few days. They do TRs on a quarterly basis.

Duane

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Joe Pluta
Sent: Wednesday, June 5, 2019 2:55 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: PTF enhancements for RPG

Duane, something I found out is thatdata structures, LIKE defines and BIFs don't always work the way you would expect, especially in relation to file definitions, due to the nature of the compiler.  For example, I just reported a situation to IBM where I couldn't use the size of a field in a file to define the size of a data structure.  See here:

dcl-f X1PF;

dcl-ds *n extfile('X1PF') end-ds; // <----- add this dcl-ds

dcl-s dummy1 char(10);
dcl-s dummy2 like(X1FLD);

dcl-ds ds1 len(%size(dummy1)) end-ds;
dcl-ds ds2 len(%size(dummy2)) end-ds;
dcl-ds ds3 len(%size(X1FLD)) end-ds;

read X1PF;
return;


Without the dcl-ds extfile (which should be extname, BTW), this won't compile; both ds1 and ds2 fail on the %size keyword.  The lab's explanation is that the field isn't wholly defined until the I specs are generated, which is too late for the DS definition.  But you can short-circuit that process by defining the data structure.  There are other issues with the external DS approach, but it does work.


On 6/5/2019 11:05 AM, Duane Scott wrote:
Thanks Jon,

I've just learned that we are on TR5, with some PTF's recently applied.

SAMEPOS works for simple data structures, but the PSDS enhancements for the Job number and System name don't.

I'm guessing that not enough PTFs were applied.

BTW - I tried copy/paste your suggestion into my program. I get:

RNF7030: The name or indicator HDIAG1 is not defined.
RNF3523: External description SET_DIAG for data structure is not found; data structure is ignored.
RNF0202: THE PARAMETER FOR SAMEPOS MUST BE A SUBFIELD PREVIOUSLY SPECIFIED IN THIS DS.

I am able to eliminate the RNF7030 and RNF0202 if I insert a line:
"diag1_set like(hdiag1) samepos(hdiag1);"
before the dcl-ds set_diag... line.

Trial and error got me that before (as in my original posting).

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwIGaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=LifWsbmXTz4aXbMMEwOi1aJ3sWD5nsP_QI4reJ8MbDM&m=8WKHJEcfCd39vQGpSji3DDuWhieNblqAsQuWHkvB5zk&s=Id0vHL_IW94IBx1A8yJIn2xL332r3IbFohTvFTXiGHk&e=
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwIGaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=LifWsbmXTz4aXbMMEwOi1aJ3sWD5nsP_QI4reJ8MbDM&m=8WKHJEcfCd39vQGpSji3DDuWhieNblqAsQuWHkvB5zk&s=WU7iopukmnv2Bkzw1AENIqVH1-Wtfo3H7PYileTaDYo&e=.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support https://urldefense.proofpoint.com/v2/url?u=http-3A__midrange.com&d=DwIGaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=LifWsbmXTz4aXbMMEwOi1aJ3sWD5nsP_QI4reJ8MbDM&m=8WKHJEcfCd39vQGpSji3DDuWhieNblqAsQuWHkvB5zk&s=r0vvy1Rh1FZbf5swhEyIvLCSs57lqv0I4eOMU4wBzOU&e= by shopping at https://urldefense.proofpoint.com/v2/url?u=http-3A__amazon.com&d=DwIGaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=LifWsbmXTz4aXbMMEwOi1aJ3sWD5nsP_QI4reJ8MbDM&m=8WKHJEcfCd39vQGpSji3DDuWhieNblqAsQuWHkvB5zk&s=-cZqPoM6LHobawv3IAaUSmH3uVxgPiZ1OrzmNf3cwoQ&e= with our affiliate link: https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwIGaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=LifWsbmXTz4aXbMMEwOi1aJ3sWD5nsP_QI4reJ8MbDM&m=8WKHJEcfCd39vQGpSji3DDuWhieNblqAsQuWHkvB5zk&s=lZqg4bCBnFuupoqWC7MC7TQA9YNAAkqkwXSEfBSZDWY&e=

CONFIDENTIALITY NOTICE: This electronic message transmission is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. If you have received this transmission, but are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the contents of this information is strictly prohibited. If you have received this e-mail in error, please contact NALC Health Benefit Plan at 703-729-4677 and delete and destroy the original message and all copies

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.