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



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 think the command is CPYFRMQRYF (not CPYFRMQF).

Then do the RTVMBRD    FILE(QTEMP/&TEMPFL) NBRCURRCD(&TEMPFLREC)

Better yet, to reduce the time if there are lots of records selected, do:

CPYFRMQRYF FROMOPNID(X) NBRRCDS(1)

which will only copy the first record.  That is all you need to see if there
are zero records!

be sure to run the command to reset the file pointer back to the start of
the file, or you would miss the first record in the next program downstream!

POSDBF POSITION(*START)

So, here are the commands:

OVRDBF ...
OPNQRYF &TEMPFL OPNID(X) ...
CPYFRMQRYF FROMOPNID(X) TOFILE(Y) NBRRCDS(1)
RTVMBRD    FILE(QTEMP/Y) NBRCURRCD(&TEMPFLREC)
POSDBF OPNID (X) POSITION(*START)



-----Original Message-----
From: alan shore [mailto:SHOREA@dime.com]
Sent: Tuesday, February 05, 2002 10:25 AM
To: midrange-l@midrange.com
Subject: Re: OPNQRYF - Zero records


My aplogies if someone has already answered this, but I was late in arriving
at work, and I am presently wading through ALL my e-mail, and I decided to
answer this as I go through the list.
Plus it makes me feel good when there is something I can answer .That
does'nt happen very often for me.

Anyway, in answer to your question,  another method is to use the following
command.
Use the CPYFRMQF to create another file from the OPNQRYF command (into QTEMP
is a suggestion) and then
RTVMBRD    FILE(QTEMP/&TEMPFL) NBRCURRCD(&TEMPFLREC)
The field   &TEMPFLREC will hold the number of records for that file.

>>> <Steven.Gray@arvalphh.co.uk> 02/05/02 07:00AM >>>
I am trying to test if the OPNQRYF file produced has no records from the
selection criteria.

I can do this by using the DSPFD to an OUTFILE and then using DCLF and RCVF
to read the 1st record which will contain the &field MBNRCD , to inform me
if there are indeed 0 records.

But,

is this the best way to go ,

as this will only allow 1 file comparison in the CL program.

If I want to test any more files for zero records , then they have to have
their own CL programs.Which is obviously not ideal.
Also the testing of this is messy , as another file has to be created which
holds the testing files data.

Regards

Steven Gray
Development/Support Analyst




_____________________________________________________________________
This message has been checked for all known viruses by UUNET delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.uk.uu.net/products/security/virus/
_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-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.