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



Also, RPG doesn't care what the starting position is for the key. It (the
starting position) for program-described files is ignored.
-Bob Cozzi


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of M. Lazarus
Sent: Sunday, June 13, 2004 1:05 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Opening files with multiple keys as program-described

James,

  I'd like to add, that unlike the /36, if the key length does not match 
the key in your file you will *not* get a runtime error.  So the program 
will go along its merry way, but produce unexpected results.

  -mark

At 6/13/04 06:47 AM, you wrote:
>James,
>
>In the F-spec you just specify the key length (20) and type (A). Type A 
>(char) might seem strange in your case, but for a compound key you'll need 
>a data structure for random access. You can specify the starting location 
>of the key with the KEYLOC keyword, but I don't think this has any use.
>
>If you need to chain to the file you have to define a data structure; in 
>your case it will have to be 20 long and should contain an 11 byte zoned 
>field an a 9 byte zoned field.
>
>Joep Beckeringh
>
>
>James H H Lampert wrote:
>
>>Something I don't quite get, in the ILE RPG docs:
>>I have a file with two non-adjacent keys.
>>Is it possible to open this file from ILE RPG as program-described (to
>>avoid level-check issues without overrides, and without disabling level
>>checking for other programs using the file), and chain it on both keys?
>>How do I code this?
>>For argument's sake, I'll call the first key "foo"; it's 11 bytes of zoned
>>decimal, starting at byte position 49 in the record. I'll call the second
>>key "bar"; it's 9 bytes of zoned decimal, starting at byte position 39 in
>>the record. I'll call the intervening byte (byte position 48) "baz."
>>And please note that, now that I have a strictly RPG query (as opposed to
>>a query that was only incidentally involving an RPG program), I have put
>>it on the RPG list, rather than the MIDRANGE list.
>>--
>>JHHL

--
This is the RPG programming on the AS400 / 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.



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.