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



I had problems with the PDSD as well. Perhaps you could report that issue to IBM - as far as they are concerned both features were in the same runtime PTF.

As to the definitions - did you add the dcl-f? If you have that as a template that should cure the errors. Otherwise I guess you have to use the qualified names on the Like clause.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jun 5, 2019, at 12:05 PM, Duane Scott <dscott@xxxxxxxxxxx> 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).

Duane


Haven't got time to try it Duane, but this should be all you need.

Just the file definition and this:

dcl-ds ar_hst1 extname('HISTORY1' : 'HST1') qualified;
dcl-ds set_diag dim(18) samepos(hdiag1);
hdiag like(hdiag1);
hdiagpoa like(hdiag1poa);
end-ds;
end-ds;


Jon Paris

On Jun 5, 2019, at 11:12 AM, Duane Scott <dscott@xxxxxxxxxxx> wrote:

Jon,

Here's a portion of the dds for the file. CDIAG is 8 bytes character, CPOA is 1 byte character
.
.
.
A HDIAG1 R TEXT('DIAGNOSIS 1')
A REFFLD(CDIAG)
A HDIAG1POA R TEXT('DIAGNOSIS 1 POA')
A REFFLD(CPOA)
A HDIAG2 R TEXT('DIAGNOSIS 2')
A REFFLD(CDIAG)
A HDIAG2POA R TEXT('DIAGNOSIS 2 POA')
A REFFLD(CPOA)
A HDIAG3 R TEXT('DIAGNOSIS 3')
A REFFLD(CDIAG)
A HDIAG3POA R TEXT('DIAGNOSIS 3 POA')
A REFFLD(CPOA)
A HDIAG4 R TEXT('DIAGNOSIS 4')
A REFFLD(CDIAG)
A HDIAG4POA R TEXT('DIAGNOSIS 4 POA')
A REFFLD(CPOA)
.
.
.
A HDIAG18 R TEXT('DIAGNOSIS 18')
A REFFLD(CDIAG)
A HDIAG18POA R TEXT('DIAGNOSIS 18 POA')
A REFFLD(CPOA)
.
.
.

Or, the DBU Field Selection
.
.
.
(Text) (Name) (Type) (Len) (Loc)
Diagnosis 1 HDIAG1 A 8 471
Diagnosis 1 Poa HDIAG1POA A 1 479
Diagnosis 2 HDIAG2 A 8 480
Diagnosis 2 Poa HDIAG2POA A 1 488
Diagnosis 3 HDIAG3 A 8 489
Diagnosis 3 Poa HDIAG3POA A 1 497
Diagnosis 4 HDIAG4 A 8 498
Diagnosis 4 Poa HDIAG4POA A 1 506
Diagnosis 5 HDIAG5 A 8 507
Diagnosis 5 Poa HDIAG5POA A 1 515
.
.
.

Duane

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Jon
Paris
Sent: Wednesday, June 5, 2019 11:00 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: PTF enhancements for RPG

Can you show an extract from the actual record layout Duane - I'm having trouble visualizing what you're trying to do.


Jon Paris

On Jun 5, 2019, at 8:55 AM, Duane Scott <dscott@xxxxxxxxxxx> wrote:

Barbara (or other excellent explainer),

This is a great feature. Except it's not working as I imagined it and as Jon Paris "exampled" it in his article in The Four Hundred: Guru: 7.4 Brings New RPG Goodies.

I've tried to work this one in on my 7.3 and am having a difficult time adjusting it to work.

My example tries to redefine a record format where 18 sets of an 8 byte character followed by a 1 byte character:

dcl-f history1 usage(*input); // rcdfmt(hst1)
dcl-ds ds_hst1 likerec(hst1) ;
dcl-ds ar_hst1 extname('HISTORY1' : 'HST1') qualified;
diag1_set like(hdiag1) samepos(hdiag1);
dcl-ds set_diag dim(18)
samepos(hdiag1);
hdiag like(hdiag1);
hdiagpoa like(hdiag1poa);
end-ds;
end-ds;

when compiling, I get:
RNF3523: External description SET_DIAG for data structure is not found; data structure is ignored.

My outline (RDi) shows that SET_DIAG has the correct elements.

I did get it to work as advertised on a single field array.

Any suggestions?


Duane Scott

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Barbara Morris
Sent: Wednesday, April 24, 2019 10:21 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: PTF enhancements for RPG

On 2019-04-23 6:06 PM, Jon Paris wrote:
The one thing this one can't do easily Joe is to create an array from non-contiguous fields - that you'll still have to use the DS/Overlay approach for.


If they were all the same distance apart, you could define a data structure array with all the repeated fields.

dcl-ds ds;
x char(5);
a1 packed(3);
b1 char(5);
a2 packed(5);
b2 char(5);
a3 char(5);
b3 char(5);
dcl-ds a_b_array dim(3) samepos(a1);
a like(a1);
b like(b1);
end-ds;
end-ds;

--
Barbara

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.
--
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@xxxxxxxxxxxx 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 ...

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.