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



Yes it does Alan. You apparently didn't get as far as page 3 where this code appears:

D Messages DS
D 20a Inz('Invalid Item Code')
D 20a Inz('Too many selections')
D 20a Inz('Item Code required')
D 20a Inz('Huh?')
D Msg 20a Overlay(Messages) Dim(4)
See - no names!

When this is converted to free-form you cannot leave the name blank because it would confuse the compiler and have to replace the blank with *N.

So the only difference is that I had to give the array a name in order to allow Overlay to be used. IBM decided that they no longer wanted to support Overlay against the DS name and so introduced POS instead and that allows the DS name to be omitted. Personally I wouldn't have omitted the DS name anyway even using POS to create the array.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jul 28, 2017, at 6:54 PM, Alan Campin <alan0307d@xxxxxxxxx> wrote:

Jon, the article you reference says nothing about *N and about using Pos.
Using *N and Pos seems to be considerable improvement to me and, of course,
free format.

The neat thing I think is I have to name nothing except the array I am
trying to create. No trying to create dummy names that are nothing but
place holders.


On Fri, Jul 28, 2017 at 3:40 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx <mailto:jon.paris@xxxxxxxxxxxxxx>> wrote:

Alan, when you say "Before I would have had to do something like ..."

When is "before" because I can't see anything in the technique that could
not have been done many moons ago. Ugly as sin but it could be done in the
original RPG IV if not RPG/400 - just not as easily.

Booth - you'll find the answers to why/how it works in this piece which
dates back to 2003. http://ibmsystemsmag.com/ibmi/ <http://ibmsystemsmag.com/ibmi/>
developer/general/d-spec-discoveries <http://ibmsystemsmag.com/ <http://ibmsystemsmag.com/>
ibmi/developer/general/d-spec-discoveries>



Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jul 28, 2017, at 6:31 PM, Alan Campin <alan0307d@xxxxxxxxx> wrote:

1. ErrorReturn is a qualified data structure that has a field named
MessageId. When you call a system API it is filled.

dcl-ds ErrorReturn LikeDs(TD_StdErrorModel) Inz(*LikeDs);

dcl-ds TD_StdErrorModel Qualified Template;
Size Int(10) Inz(%Size(TD_StdErrorModel));
BytesAvailable Int(10) Inz(0);
MessageId Char(7);
*N Char(1); <<--- Reserved piece of memory but
you don't need to name.
MessageData Char(1024);
end-ds;

What I am showing is a lookup array but I am only naming the array. *N
means no name.

Before I would have had to do something like

dcl-ds dsOkList;
MsgId1 Char(7) Inz('CPF3C51');
Msgid2 Char(7) Inz('CPF3C52');
MsgId3 Char(7) Inz('CPF3C53');
MsgId4 Char(7) Inz('CPF3C54');
MsgId5 Char(7) Inz('CPF3C55');
OkList Char(7) Dim(5) Overlay(dsOkList) Ascend;
end-ds;

The same thing but a lot more work and I don't need to worry about name
conflicts. MsgId1 is global in the procedure. If you name another
variable
MsgId1 it would conflict. With *N, no name. Just storage allocated.

On Fri, Jul 28, 2017 at 3:06 PM, Booth Martin <booth@xxxxxxxxxxxx>
wrote:

It takes me a while to catch on. Its not clear to me exactly what is
happening here. I do not understand ErrorReturn.MessageID and I'd also
bet
I do not understand *N

I say this because it looks to me like it doesn't do anything we
couldn't
already do with the same basic code. Therefore I am assuming I am
missing
something?

On 7/28/2017 1:18 PM, JRusling@xxxxxxxxxxx wrote:

It is...!

<snip>
dcl-ds *N;
*N Char(7) Inz('CPF3C51');
*N Char(7) Inz('CPF3C52');
*N Char(7) Inz('CPF3C53');
*N Char(7) Inz('CPF3C54');
*N Char(7) Inz('CPF3C55');
OkList Char(7) Dim(5) Pos(1) Ascend;
end-ds;


If %Lookup(ErrorReturn.MessageId:OkList) > 0;
</snip>


--
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: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://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 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: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://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 is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx <mailto:RPG400-L@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l <http://lists.midrange.com/mailman/listinfo/rpg400-l>
or email: RPG400-L-request@xxxxxxxxxxxx <mailto:RPG400-L-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l <http://archive.midrange.com/rpg400-l>.

Please contact support@xxxxxxxxxxxx <mailto:support@xxxxxxxxxxxx> for any subscription related
questions.

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

--
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 <mailto:RPG400-L@xxxxxxxxxxxx>
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l <http://lists.midrange.com/mailman/listinfo/rpg400-l>
or email: RPG400-L-request@xxxxxxxxxxxx <mailto:RPG400-L-request@xxxxxxxxxxxx>
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l <http://archive.midrange.com/rpg400-l>.

Please contact support@xxxxxxxxxxxx <mailto:support@xxxxxxxxxxxx> for any subscription related questions.

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

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.