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


  • Subject: Re: Re-key PF or LF
  • From: Michael Pavlak <gmpavlak@xxxxxxxxx>
  • Date: Wed, 14 Oct 1998 12:23:40 -0500

I'm sorry, you indicated OPNQRYF.  Try using the KEYFLD parameter on OPNQRYF.  
If
you are just doing sequential processing in your RPG or COBOL program, leave 
off the
K in the F Spec.  the records will flow to your program in the correct 
sequence.  If
you wish to do random access, however, you will need the Logical File for the
compile, at the very least.  Note, another neat trick with OPNQRYF and KEYFLD 
is the
UNIQUEKEY parameter which can force a single occurrance of duplicate keys.  This
type of output comes in handy for SQL joins, etc...

Enjoy!

Mike

ikat@dircon.co.uk wrote:

> Hello -- here is a little question for all you out in AS/400 land.
>
> Is there a way to key a PF without using a LF and not putting K spec in the 
>PF ?
>
> Heres what I got.
> 1 PF that has over 14000 records in it, of which I want 51.
> so I crtdupobj, and sql the records I need. The RPG prog then
> needs to read this file with keys. but there arn't any ! Must I
> create a temp LF or is there a way of using opnqryf (or something)
> that can put the keys into the PF.
>
> Hope this makes sense :)
> Marc Woodbridge.
>
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
> * This is the RPG/400 Discussion Mailing List!  To submit a new         *
> * message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
> * from this list send email to MAJORDOMO@midrange.com and specify       *
> * 'unsubscribe RPG400-L' in the body of your message.  Questions should *
> * be directed to the list owner / operator: david@midrange.com          *
> * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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.