× 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: OPNQRYF a flat file?
  • From: rob@xxxxxxxxx
  • Date: Wed, 28 Feb 2001 13:34:46 -0500


Oh the horrors of OPNQRYF!  How about:

Create an empty physical which is externally defined and use that as an
externally defined data structure.  Use your imbedded SQL to select or
fetch INTO this data structure.


Rob Berendt

==================
Remember the Cole!


                                                                                
                                         
                    D.BALE@handleman.co                                         
                                         
                    m                          To:     MIDRANGE-L@midrange.com  
                                         
                    Sent by:                   cc:                              
                                         
                    owner-midrange-l@mi        Subject:     OPNQRYF a flat 
file?                                         
                    drange.com                                                  
                                         
                                                                                
                                         
                                                                                
                                         
                    02/28/01 12:10 PM                                           
                                         
                    Please respond to                                           
                                         
                    MIDRANGE-L                                                  
                                         
                                                                                
                                         
                                                                                
                                         




Can OPNQRYF be used on a non-externally described flatfile?  The flatfile
maps
to a file that is externally described, and will eventually be copied to
files
with the externally described format, but first I have to run the flatfile
through OPNQRYF to determine all the unique release numbers found in the
file.
 Note that ASNPK is the externally described file and DANBALEZ is the
non-externally described flatfile.  ORRNPK is the Release Number field,
defined as 7-digits, zoned decimal.

> OVRDBF FILE(ASNPK) TOFILE(DANBALEZ) SHARE(*YES)
> OPNQRYF FILE((ASNPK)) KEYFLD((ORRNPK)) UNIQUEKEY(*ALL)
  File ASNPK overridden.
  Field ORRNPK on KEYFLD parameter not found.
  Error occurred during processing of command.

So then I tried:

> ovrdbf danbalez share(*yes)
> OPNQRYF FILE((DANBALEZ)) FORMAT(ASNPK)
     KEYFLD((ORRNPK)) UNIQUEKEY(*ALL)
  Field BRANPK on FORMAT parameter not found.
  Error occurred during processing of command.

BRANPK is the first field defined in the ASNPK record format.  I got the
feeling that I'd have to MAPFLD all 79 fields in the ASNPK file to get this
to
work.  Not worth it.

Note: PTCKON08 is the flatfile's record format name & single field name.

> ovrdbf danbalez share(*yes)
> OPNQRYF FILE((DANBALEZ)) KEYFLD((ORRNPK)) UNIQUEKEY(*ALL)
     MAPFLD((ORRNPK '%sst( PTCKON08  524  7 )' *ZONED 7 0))
  Key field *MAPFLD/ORRNPK not valid for record format.
  Error occurred during processing of command.

> ovrdbf danbalez share(*yes)
> OPNQRYF FILE((DANBALEZ)) FORMAT(ASNPK) KEYFLD((ORRNPK))
     UNIQUEKEY(*ALL)
     MAPFLD((ORRNPK '%sst( PTCKON08  524  7 )' *ZONED 7 0))
  Field BRANPK on FORMAT parameter not found.
  Error occurred during processing of command.

> OVRDBF FILE(ASNPK) TOFILE(DANBALEZ) SHARE(*YES)
> OPNQRYF FILE((ASNPK)) KEYFLD((ORRNPK)) UNIQUEKEY(*ALL)
  File ASNPK overridden.
  Field ORRNPK on KEYFLD parameter not found.
  Error occurred during processing of command.

> OVRDBF FILE(ASNPK) TOFILE(DANBALEZ) SHARE(*YES)
> OPNQRYF FILE((ASNPK)) FORMAT(ASNPK) KEYFLD((ORRNPK))
     UNIQUEKEY(*ALL)
  File ASNPK overridden.
  Field BRANPK on FORMAT parameter not found.
  Error occurred during processing of command.

SO I AM ASKING...  CAN THIS BE DONE WITH OPNQRYF?  Or am I stuck with
having
to use an RPG solution?

Dan Bale
IT - AS/400
Handleman Company
248-362-4400  Ext. 4952
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to
MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---



+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.