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



Yeah, I read your message - and understood the USROPN part, but if the
OP was going to question the CL command I was going to recommend
SYSTEM() so he wouldn't have to leave the RPG part of the program. Gotta
look further into the EXTFILE part...

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Tuesday, May 15, 2007 2:38 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Validate Data library name

No problem Dave. I'm all for learning. Noticed that your reply came
after my replies, which had the more updated methods (especially the
USROPN and EXTFILE keywords). That's probably why I posted my reply.

Back in the day, it seemed like almost a standard that every RPG/400
program had to be wrapped in a CL program (I even think some CASE tools
enforced this). Back then, I'd wager that 75%, or more, of all CL
programs were nothing more than the simple overrides, if even that much.

The addition of keywords, like EXTFILE and that genre, made this so much
cleaner.

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





"Turnidge, Dave" <DTurnidge@xxxxxxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/15/2007 03:27 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






I'll bet! But when you give help, you do the best you can, relying on
others that know better to correct anything that's wrong. The best part
about that is that sometimes the person that is correcting you tells you
what is wrong, and you can learn from it. I'm still - and hopefully
always will be - learning...

Dave

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Tuesday, May 15, 2007 2:21 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Validate Data library name

Gee, that sounds so RPG/400 vs. RPGLE.

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





"Turnidge, Dave" <DTurnidge@xxxxxxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
05/15/2007 03:18 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






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

Follow-Ups:
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.