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



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


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.