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



The documentation for the chain op code does list files or record formats.
However the description of %KDS only references record formats.  Because the
keyed data structure you have defined is built over a specific record format
the chain must have the corresponding format.


 -----Original Message-----
From:   Svir, Stacy A. (CC-IS) [mailto:SASvir@carlsoncraft.com]
Sent:   Wednesday, November 13, 2002 2:08 PM
To:     rpg400-l@midrange.com
Subject:        v5r2 enhancements for Keyed I/O

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
> I am trying to use the v5r2 enhancements for Keyed I/O.
>
>From what I have read I should be able to use the file name or the record
format name on the I/O (chain,read....)
When using a data structure to replace a klist, I get a compile error if I
use the file name.
Using the record format name when using a data structure works.

I was just wondering if this is correct or if I might be missing something.


Compile error:
> *RNF7071 30     52 001300  Number of KFLDs in KLIST is greater than number
> of key fields in file.
>
> If I replace the line:
>    Chain %KDS(dsDlrInv) Arfile01L;  // use the file name
>
> with
>    Chain %KDS(dsDlrInv) Rarfile;    // use the record format
> it compiles and works.
>
> The Chain using the fields works either using the file or the record
> format name.
>
>
> // Sample code.  Arfile01L is a logical by Dealer # and Invoice #.  Record
> format is: Rarfile
>
> FArfile01L IF   E           K Disk
>
> D dsDlrInv      E DS                  ExtName(Arfile01L:*Key)
> D                                     Prefix(k)
>
> D itworked        S               N
>
>  /free
>
>   kDlrno = 99980;
>   kInvno = 1144355;
>
>   Chain %KDS(dsDlrInv) Arfile01L;
>   If %Found(Arfile01L);
>      itworked = *On;
>   Else;
>      itworked = *Off;
>   Endif;
>
>   Chain (kDlrno:kInvno) Arfile01L;
>   If %Found(Arfile01l);
>      itworked = *On;
>   Else;
>      itworked = *Off;
>   Endif;
>
>   *INLR = *ON;
>
>  /end-free
>
Thanks in advance
Stacy

_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
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 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.