You can't do this right now but you could set an arbitrary high limit and then use the result of a count over sys columns for the table with %SubArry to restrict the number you access.

In this case though you appear to be building the null map for a known file - so why not just use Extname with the *null option and have the compiler generate the list you want?


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Oct 18, 2018, at 10:13 AM, JRusling@xxxxxxxxxxx wrote:

ie, i would like the gF1Null dcl-s stmt to be :

dcl-s gF1Null int(5) dim(%columns('ORDD30WF1')) ;

instead of hardcoding the column count.

ORDD30WF1 is an externally ddl described work file.

tia,

John
(make sense?)


dcl-ds gF1Ds extname('ORDD30WF1') inz qualified end-ds;
dcl-s gF1Null int(5) dim( 8) ;
dcl-ds gF2Ds extname('ORDD30WF2') inz qualified end-ds;
dcl-s gF2Null int(5) dim(20) ;

select t1.*,t2.*
from ordd30wf1 t1 left outer join ordd30wf2 t2
on t1.ordnbr=t2.ordnbr and t1.ordlinnbr=t2.ordlinnbr

exec sql fetch mycsrF1 into :gF1Ds :gF1Null, :gF2Ds :gF2Null ;

if gF2Null(1) = -1 ;
status( %char(gF1Ds.ordnbr) ) ;
else ;
status( %char(gF1Ds.ordnbr) + ' ' + gF2Ds.FDNAME ) ;
endif ;
<br />
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD


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-2020 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].