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



Amy, asuming your file looks more or less like the following:

File: AmyFile

    R RECORD
        FLD1         1A
        FLD2       10A
        FLD3     117A
    K FLD2

Could you define a logical over it as follows: ?

File AmiLog
                                         UNIQUE
    R RECL                        PFILE(AmyLib/AmyFile)
        FLD1           1A
        FLD2A8       8A   I    SST(FLD2 1 8)
        FLD2A2       2A   I    SST(FLD2 9 2)
        FLD3        117
    K FLD2A8

The "I" in FLD2A8 and FLD2A2 stands for "Input only" as being a substring of a 
real field
cannot be defined as updat_capable... I don't remember its exact position, but 
should be
more or less where I've put it...

In this way, you can go on working with your normal "Amyfile", but the system 
will check
there are no duplicate values in the first 8 chars of FLD2 since AmiLog is 
defined as
UNIQUE ...

Hope this helps, Antonio
________________________________________________________________

AAnuszewski@hammer.net escribió:

> If a physical file has been defined as being comprised of 3 fields:
>
> a character field of length 1
> a character field of length 10 that designates the key
> and a character field of length 117 that designates the rest of the data
>
> Is it possible for me to generate a different record format for this file and
> actually have it work as a keyed file?
>
> The issue is that the 10 character key is actually TWO fields - an 8 character
> field and a 2 byte numeric.  I do even care WHAT is stored in the 2 character
> numeric field.  I just need to ensure that there is not another record 
>matching
> the first 8 characters.
>
> What I need to do is define the record format to look like
>
> a character field of length 1
> a character field of length 8 - designated as key
> a numeric field 2 bytes long - don't care if this is designated key or not
> various length character, numeric, and packed decimal fields to comprise the
> remaining 117 bytes
>
> I can make this work with a sequential file and read the data.  However, I can
> NOT get my program to recognize the key unless I keep it at 10 characters 
>long,
> which is impossible.
>
> Amy
>
> _______________________________________________
> This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) 
>mailing list
> To post a message email: JAVA400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l
> or email: JAVA400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/java400-l.

--
-------------------------
Antonio Fernandez-Vicenti
afvaiv@wanadoo.es




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.