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



What release/PTF level are you on Marco? There have been changes in this area over the last few years.


Jon P.

On Aug 22, 2022, at 10:58 AM, Marco Facchinetti <marco.facchinetti@xxxxxxxxx> wrote:

Thanks Chris,

I did it, using likerec insted of extname and it's working.

However, I see no obvious reason to prevent the use of a Ds likerec based
on an identical record format but only with a different name.

Best regards
--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco


Il giorno lun 22 ago 2022 alle ore 16:44 Hiebert, Chris <
chris.hiebert@xxxxxxxxxxxxxx> ha scritto:

I've seen that RPG won't allow a data structure for input unless it was
specifically defined for the file being read.


To get it to work you can just define a local ds for each file.

Dcl-ds inGogge11 EXTNAME(mugogge01l:*INPUT) QUALIFIED END-DS;

Chain (mugogge01l) inGogge11;
If %found(mugogge01l);
Eval-corr xGogge = inGogge11;
Endif;


--
Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author
and do not necessarily represent those of the company.

From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Marco
Facchinetti
Sent: Friday, August 19, 2022 6:42 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Likerec usage


Hi, probably it's very simple but I don't see where is the problem.



The compiler complaines (RNF7595 The result data structure does not include

a subfield in position 1 for a record format) on the chain (mugogge02l and

mugogge03l). The 3 record formats are exactly the same.





Dcl-f mugogge01l disk keyed usage(*input) usropn rename(gogge:gogge1);

Dcl-f mugogge02l disk keyed usage(*input) usropn rename(gogge:gogge2);

Dcl-f mugogge03l disk keyed usage(*input) usropn rename(gogge:gogge3);





Dcl-Proc v_Gogge;



Dcl-Pi *n ind;

Oggetto like(genclass) const;

xGogge likerec(gogge1:*all);

End-pi;



if %scan(%subst(Oggetto:1:1):'0123456789') > 0;

chain (Oggetto) mugogge01l xGogge;

Else;

chain Oggetto mugogge03l xGogge;

if not %found();

chain (Oggetto) mugogge02l xGogge;

Endif;

EndIf;



return %found();



end-proc;



Best regards

--

Marco Facchinetti
--
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://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
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://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com


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.