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



good luck with the SOX effort...we've been working in that direction for a
while...everything looks good until the auditors get started...

Thanks,
Tommy Holden




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






Yeah, I've used QCMDEXC and then buried myself trying to understand all
the "wee bit more work" with QCAPCMD. Then, as I was messing with some
programs that used API's I ran across system() and (I don't remember
why, but) I liked it.

My exposure to heavy ILE is very limited - but is one of the reasons I
don't feel that monitoring this forum is a waste of company time -
unless people go on the "which airport to use" rants... My main focus
right now is tracking SOX stuff on our 12 excellent, wonderful, best
computers ever, that are eventually being kicked out of the company...
And tracking backup success on said systems. My programming is to
attempt to make those jobs "easier", and as I can, I attempt to do what
I do in an ILE fashion. Some of it is actually sticking!!

So, all said to say I appreciate your input, and Joe's and Pat's and
Scott's and Bob's, etc., input into my on-going education.

Thank y'all!

Dave

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

I used to be quite enamored with system() vs QCMDEXC. However I
discovered that QCMDEXC updates the Program Status Data Structure (PSDS)
with message exception data, which I often beneficial and lacking with
system(). Yes, you can get the error number with system() but having
the message data, along with the message number can really help. Now,
the only thing that system() brings to the party that qcmdexc doesn't is
that
system() stays in the same activation group as the caller. But, if
you're using EXTFILE, etc then much of that benefit is diminished
because those types of overrides can often be done internally with
RPGLE.
The Cadillac of command processors is the QCAPCMD api. That's nice, but
a wee bit more work. Granted, all simplified with the right wrappers.
One often has to be careful with some wrappers though, especially with
QCAPCMD, due to overrides and activation group concerns.

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:42 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






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.