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



ok i have to ask....what is the end goal of this? maybe there is a better
way...but Dave and Rob have both given you viable solutions based on the
information given.

Thanks,
Tommy Holden




"Turnidge, Dave" <DTurnidge@xxxxxxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/15/2007 02:16 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: Validate Data library name






OVRDBF so that ABC is in library XYZ, then open the file.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of derek gonsalves
Sent: Tuesday, May 15, 2007 2:12 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Validate Data library name


Screen 1.1


Data Library Name : ________

Company Number : ________






User enters the data library as XYZ
XYZ exists in the AS400
Now when i do a validation for the company number with the company
master ABC

#CMPNO Chain ABC
If %found
Else
Eval Error = 'Y'
Endif

My question is if ABC is present in other libraries too, then it will
validate it against the one in the first library on the library list.
So will i have to handle the Edtlibl in the program and move XYZ on top
so that it validates against ABC in XYZ library.? Can this be done using
QCMDEXEC or will i have to call a seperate CL program for this? OR Can
it be done using SQLRPGLE?

Select * from XYZ/ABC where CMPNO = #CMPNO

If SQLCOD = 0 OR SQLCOD = 100
Eval Error = 'Y'
Endif


From: rob@xxxxxxxxx
Reply-To: RPG programming on the AS400 / iSeries
<rpg400-l@xxxxxxxxxxxx>
To: RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
Subject: Re: Validate Data library name
Date: Tue, 15 May 2007 13:56:49 -0400

Keeping in mind that you said a "data" library. Also keep in mind that

you are going to access a file that is in that library to validate the
company number.

CHKOBJ on the object itself is one method. If you prompt it, move your

cursor to the title line and press F1 you can see what messages you can

monitor for. Anything from library doesn't exist to file doesn't
exist, etc. I'd check for the end file you are looking for.

Another method is to open the desired file manually
FDataFile IF E disk USROPN EXTFILE(TheName)
D TheName s 21a varying
/free
TheName=%trimr(library + '/' + File); // library came from prompt
screen
monitor;
Open DataFile;
on-error xxxxx; // replace xxxxx with the error code for library
doesn't exist
// see file/exception handling in the rpg reference and/or program

guide
EndMon;
...

Another method
/free
x=0;
execsql select count(*) into :x
from qsys2/syscolumns
where system_column_name=:fieldName
and system_table_name=:FileName
and system_schema_name=:Library;
If x=0;
// column :fieldName from table :FileName is not in library
:Library
EndIf;

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





David Gibbs <david@xxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/15/2007 01:34 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> cc

Fax to

Subject
Re: Validate Data library name






derek gonsalves wrote:
I have a program wherein the user enters the data library name on
the screen, and the company name. Now I first need to validate if
the library is a valid AS400 library and if yes then i need to
validate the company number from the company master file present in
that data
library.
Any suggestions on how this can be handled??

QUSLOBJ API
(http://publib.boulder.ibm.com/iseries/v5r2/ic2924/info/apis/quslobj.ht
m) will let you validate that the library exists.

david

--
Check out the midrange.com System i Wiki: http://wiki.midrange.com
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.


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

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.