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



Here we use some qualified data structure magic to accomplish the goal.

You could must make a data structure to map the names. Then use EVAL-CORR to extract the values from the original.

This works because "Containers" is qualified. And the process pulls the like definitions from the unqualified TLAShpLbl definition.
Then, since the data structures contain fields of the same name, you can use EVAL-CORR to map between them.

Dcl-ds TLAShpLbl Ext End-ds;

Dcl-DS Containers Qualified;
SlOthCtr1 Like(SlOthCtr1 );
SlOthCtr2 Like(SlOthCtr2 );
SlOthCtr3 Like(SlOthCtr3 );
SlOthCtr4 Like(SlOthCtr4 );
SlOthCtr5 Like(SlOthCtr5 );
SlOthCtr6 Like(SlOthCtr6 );
SlOthCtr7 Like(SlOthCtr7 );
SlOthCtr8 Like(SlOthCtr8 );
SlOthCtr9 Like(SlOthCtr9 );
SlOthCtr10 Like(SlOthCtr10);
SlOthCtr11 Like(SlOthCtr11);
SlOthCtr12 Like(SlOthCtr12);
SlOthCtr13 Like(SlOthCtr13);
SlOthCtr14 Like(SlOthCtr14);
SlOthCtr15 Like(SlOthCtr15);
SlOthCtr16 Like(SlOthCtr16);
SlOthCtr17 Like(SlOthCtr17);
SlOthCtr18 Like(SlOthCtr18);
SlOthCtr19 Like(SlOthCtr19);
SlOthCtr20 Like(SlOthCtr20);
SlOthCtr21 Like(SlOthCtr21);
SlOthCtr22 Like(SlOthCtr22);
SlOthCtr23 Like(SlOthCtr23);
SlOthCtr24 Like(SlOthCtr24);
SlOthCtr25 Like(SlOthCtr25);
SlOthCtr26 Like(SlOthCtr26);
SlOthCtr27 Like(SlOthCtr27);
SlOthCtr28 Like(SlOthCtr28);


A Like(SlOthCtr1 ) Samepos(SlOthCtr1) Dim(40);
A_pos Like(SlOthCtr1 ) Pos(1) Dim(40);
End-Ds;


Dcl-s idx int(10);
Dcl-s what Like(Containers.A);


Eval-Corr Containers = TLAShpLbl;

For idx = 1 to %Elem(Containers.A);
what = Containers.A(idx);
Containers.A(idx) = %Editc(idx:'X');
Endfor;

Eval-Corr TLAShpLbl = Containers;


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.
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
(WalzCraft) Jerry Forss
Sent: Friday, March 12, 2021 10:12 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: RE: File Fields In Array

One point of clarification.
I am using the ext definition for the file, not chaining.

This is for print TLA Labels.

Here is where I am at.

// DS For TLA Shipping Label
Dcl-ds TLAShpLbl Ext End-ds;

Dcl-DS *N;
SlOthCtr1;
SlOthCtr2;
SlOthCtr3;
SlOthCtr4;
SlOthCtr5;
SlOthCtr6;
SlOthCtr7;
SlOthCtr8;
SlOthCtr9;
SlOthCtr10;
SlOthCtr11;
SlOthCtr12;
SlOthCtr13;
SlOthCtr14;
SlOthCtr15;
SlOthCtr16;
SlOthCtr17;
SlOthCtr18;
SlOthCtr19;
SlOthCtr20;
SlOthCtr21;
SlOthCtr22;
SlOthCtr23;
SlOthCtr24;
SlOthCtr25;
SlOthCtr26;
SlOthCtr27;
SlOthCtr28;
SlOthCtr Like(SlOthCtr1) Dim(28) Pos(1);
End-Ds;

Compile error.

003200 Dcl-DS *n;
003300 SlOthCtr1;
======> aaaaaaaaa
======> bbbbbbbbb
*RNF3315 20 a 003300 The Name entry is already defined on a Definition
Specification; defaults to blanks.
*RNF3438 30 b 003300 LIKE keyword is expected for field but not found;
definition is ignored.


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Vern
Hamberg
Sent: Friday, March 12, 2021 11:04 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Re: File Fields In Array

There is no guarantee that fields are contiguous in the buffer - according to
Jon Paris.

Try the suggestion of just using the names at the start of the DS, then the
Containers array at the end, positioned at the start of the structure - another
post had suggested that, right?

Vern

On 3/12/2021 10:41 AM, Henderson, Liam via RPG400-L wrote:
How about something like this:

Dcl-DS DS0 ExtName('FILE' : *Input);
ContainerChar(40) Dim(28) Pos(xx);
End-DS;

Where Pos(xx) is the position of the first field in the external file. I presume
they're grouped together.




Liam Henderson | Application Consultant | Getronics

T. +441908992044 | M. +447985875181 | E.
Liam.Henderson@xxxxxxxxxxxxx
| W.
https://urldefense.com/v3/__http://www.getronics.com__;!!O6xM9Yim9Yk
!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5fr64i7g$




Getronics Services UK Limited - Registered in England and Wales with No:
07966594. VAT No: GB 130 6848 20.
Registered Office - Getronics, Level 30, The Leadenhall Building, 122
Leadenhall Street, London, EC3V 4AB, UK?
?
The information transmitted is intended only for use by the addressee and
may contain confidential and/or privileged material. Any review, re-
transmission, dissemination or other use of it, or the taking of any action in
reliance upon this information by persons and/or entities other than the
intended recipient is prohibited. If you received this in error, please inform
the sender and/or addressee immediately and delete the material. ?Thank
you.

Legal disclaimer:
https://urldefense.com/v3/__http://www.getronics.com/legal/__;!!O6xM9
Yim9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5hUWv09A$ -----Original
Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
smith5646midrange@xxxxxxxxx
Sent: 12 March 2021 16:40
To: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: File Fields In Array

CAUTION: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know
the content is safe.

I'm very weak on totally free code (my client won't let me use it) so this
might be wrong.

Don't you just need to add a CHAR(40) to your containers line?

Containers char(40) Dim(28);


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
(WalzCraft) Jerry Forss
Sent: Friday, March 12, 2021 11:10 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: File Fields In Array

Hi All,

I know this is a simple question but is escaping me at the moment.

I have a file that contains fields SLOTHCTR1 - SLOTHCTR28, each 40 char.

I want to have these loaded into an array because I need to change some,
print label, change again, print and so on.

Changing by index would be immensely less coding then changing the field
directly.

This is basically what I what it to look like.

Dcl-DS *n;
Containers Dim(28);
SlOthCtr1 Char(40) Overlay(Containers);
SlOthCtr2 Char(40) Overlay(Containers : *Next);
SlOthCtr3 Char(40) Overlay(Containers : *Next);
SlOthCtr4 Char(40) Overlay(Containers : *Next);
SlOthCtr5 Char(40) Overlay(Containers : *Next);
SlOthCtr6 Char(40) Overlay(Containers : *Next);
SlOthCtr7 Char(40) Overlay(Containers : *Next);
SlOthCtr8 Char(40) Overlay(Containers : *Next);
SlOthCtr9 Char(40) Overlay(Containers : *Next);
SlOthCtr10 Char(40) Overlay(Containers : *Next);
SlOthCtr11 Char(40) Overlay(Containers : *Next);
SlOthCtr12 Char(40) Overlay(Containers : *Next);
SlOthCtr13 Char(40) Overlay(Containers : *Next);
SlOthCtr14 Char(40) Overlay(Containers : *Next);
SlOthCtr15 Char(40) Overlay(Containers : *Next);
SlOthCtr16 Char(40) Overlay(Containers : *Next);
SlOthCtr17 Char(40) Overlay(Containers : *Next);
SlOthCtr18 Char(40) Overlay(Containers : *Next);
SlOthCtr19 Char(40) Overlay(Containers : *Next);
SlOthCtr20 Char(40) Overlay(Containers : *Next);
SlOthCtr21 Char(40) Overlay(Containers : *Next);
SlOthCtr22 Char(40) Overlay(Containers : *Next);
SlOthCtr23 Char(40) Overlay(Containers : *Next);
SlOthCtr24 Char(40) Overlay(Containers : *Next);
SlOthCtr25 Char(40) Overlay(Containers : *Next);
SlOthCtr26 Char(40) Overlay(Containers : *Next);
SlOthCtr27 Char(40) Overlay(Containers : *Next);
SlOthCtr28 Char(40) Overlay(Containers : *Next);
End-Ds;

That way I can change the fields by changing the Containers(x);

What should this look like?



Subject to Change Notice:

WalzCraft reserves the right to improve designs, and to change
specifications without notice.

Confidentiality Notice:

This message and any attachments may contain confidential and privileged
information that is protected by law. The information contained herein is
transmitted for the sole use of the intended recipient(s) and should "only"
pertain to "WalzCraft" company matters. If you are not the intended
recipient or designated agent of the recipient of such information,
you are hereby notified that any use, dissemination, copying or
retention of this email or the information contained herein is
strictly prohibited and may subject you to penalties under federal
and/or state law. If you received this email in error, please notify
the sender immediately and permanently delete this email. Thank You

WalzCraft PO Box 1748 La Crosse, WI, 54602-1748

https://urldefense.com/v3/__http://www.walzcraft.com__;!!O6xM9Yim9Yk
!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE7TDglTVA$
<https://urldefense.com/v3/__http://www.walzcraft.com__;!!O6xM9Yim9Y
k!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE7TDglTVA$ > Phone: 1-800-237-1326
--
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.com/v3/__https://lists.midrange.com/mailman/listinfo/r
pg400-l__;!!O6xM9Yim9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE7_yA9b9w$
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.com/v3/__https://archive.midrange.com/rpg400-
l__;!!O6xM9Yim9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5s02tYGA$ .

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

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

https://urldefense.com/v3/__https://amazon.midrange.com__;!!O6xM9Yi
m9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5_bZmj5g$

--
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.com/v3/__https://lists.midrange.com/mailman/listinfo/r
pg400-l__;!!O6xM9Yim9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE7_yA9b9w$
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.com/v3/__https://archive.midrange.com/rpg400-
l__;!!O6xM9Yim9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5s02tYGA$ .

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://urldefense.com/v3/__https://amazon.midrange.com__;!!O6xM9Yi
m9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5_bZmj5g$

--
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.com/v3/__https://lists.midrange.com/mailman/listinfo/r
pg400-l__;!!O6xM9Yim9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE7_yA9b9w$
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://urldefense.com/v3/__https://archive.midrange.com/rpg400-
l__;!!O6xM9Yim9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5s02tYGA$ .

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://urldefense.com/v3/__https://amazon.midrange.com__;!!O6xM9Yi
m9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5_bZmj5g$



Subject to Change Notice:

WalzCraft reserves the right to improve designs, and to change specifications
without notice.

Confidentiality Notice:

This message and any attachments may contain confidential and privileged
information that is protected by law. The information contained herein is
transmitted for the sole use of the intended recipient(s) and should "only"
pertain to "WalzCraft" company matters. If you are not the intended
recipient or designated agent of the recipient of such information, you are
hereby notified that any use, dissemination, copying or retention of this
email or the information contained herein is strictly prohibited and may
subject you to penalties under federal and/or state law. If you received this
email in error, please notify the sender immediately and permanently delete
this email. Thank You

WalzCraft PO Box 1748 La Crosse, WI, 54602-1748
https://urldefense.com/v3/__http://www.walzcraft.com__;!!O6xM9Yim9Yk
!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE7TDglTVA$
<https://urldefense.com/v3/__http://www.walzcraft.com__;!!O6xM9Yim9Y
k!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE7TDglTVA$ > Phone: 1-800-237-1326
--
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.com/v3/__https://lists.midrange.com/mailman/listinfo/r
pg400-l__;!!O6xM9Yim9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE7_yA9b9w$
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://urldefense.com/v3/__https://archive.midrange.com/rpg400-
l__;!!O6xM9Yim9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5s02tYGA$ .

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://urldefense.com/v3/__https://amazon.midrange.com__;!!O6xM9Yi
m9Yk!qHAwYi9MACBYfNNBwz_Kka8S-J9xRgv16jUPlV-
_OEpKJvpqvoLoZQTftWQtAE5_bZmj5g$

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.