|
Why LANGUAGE RPGLE
When it's a CL program?
Also PARAMETER STYLE GENERAL WITH NULLS isn't correct.
HTH,
Charles
On Fri, Sep 6, 2024 at 12:16 PM K Crawford <kscx3ksc@xxxxxxxxx> wrote:
Chicken lips. I have been trying all day to get this to work. I amsure a
better way exists but...DTAARA(CHKIFS)
I have a CLLE that I have tested. working as I want.
I created a stored procedure that I have tested and it works fine.
Now trying to get a UDF created can not get it to work. The value it
returns is <NULL>.
I have tried several ways in both the procedure and function.
This is my CLLE works:
docsys/FldrExist.clle
PGM PARM(&PATHNAME &RESULT)
DCL VAR(&PATHNAME) TYPE(*CHAR) LEN(132)
DCL VAR(&RESULT) TYPE(*CHAR) LEN(20)
DCL VAR(&dtaaraval) TYPE(*CHAR) LEN(2)
/*
*/
qmgtools/CHKIFS IFSDIR(&PATHNAME) CRTDTAARA(Y)
+someone
DTAARALIB(QTEMP)
RTVDTAARA DTAARA(QTEMP/CHKIFS (1 2)) RTNVAR(&DTAARAVAL)
IF COND(&DTAARAVAL = '00') THEN(DO)
CHGVAR &RESULT 'Obj_Not_Found'
enddo
IF COND(&DTAARAVAL = '10') THEN(DO)
CHGVAR &RESULT 'Obj_Found'
enddo
ENDPGM: ENDPGM
This is my stored procedure create:
CREATE OR *REPLACE* PROCEDURE docsys.folderExist (
IN PathName *CHAR*(*132*),
INOUT results *CHAR*(*20*)
)
LANGUAGE RPGLE
NO SQL
DETERMINISTIC
EXTERNAL NAME docsys.fldrexist
PARAMETER STYLE GENERAL WITH NULLS
This is my test of stored procedure:
call docsys.folderexist ('/home/kcrawfrd', ' ')
The result is 'Obj_Found'
This is my function:
CREATE OR *REPLACE* FUNCTION docsys.Folder_Exist (
PathName *CHAR*(*132*)
)
RETURNS *CHAR*(*20*)
LANGUAGE sql
DETERMINISTIC
BEGIN
DECLARE Results *CHAR*(*20*);
CALL docsys.FolderExist(
PathName,
Results
);
RETURN Results;
END
This is my test of function:
SELECT '/home/kcrawfrd',
docsys.Folder_exist('/home/kcrawfrd')
FROM sysibm.sysdummy1
The result in second column is <NULL>
TIA
On Fri, Sep 6, 2024 at 8:18 AM Rob Berendt <robertowenberendt@xxxxxxxxx>
wrote:
Wrap a UDF which gets the results of that command?
QMGTOOLS is not the only version of CHKIFS in the ether. Perhaps
ishas a UDF wrapped around that version?
On Fri, Sep 6, 2024 at 8:54 AM K Crawford <kscx3ksc@xxxxxxxxx> wrote:
Jack, the SQL works over a native IFS drive but not a mounted drive.
Rob, I will look at the QMGTOOLS/CHKIFS a bit more. my first glance
thanyesthis.
it works. It is creating a data area and putting 00 in it if thedirectory
did not exist and a 01 if it did. Trying to figure out how to use
thatMy hope was using my ctrlFile come up with a list of all directories
thatdo not exist. With the CHKIFS using a data area not sure how to use
willwith my SQL statement. I guess I will need to write a program that
read the ctrlFile run the command CHKIFS look at the data area thendecide
if it was found or not populating table. That is a bit more work
Ihow
robertowenberendt@xxxxxxxxx>wanted to do. Lazy at heart.
On Fri, Sep 6, 2024 at 6:31 AM Rob Berendt <
wrote:
I have a mounted directory. This works
QMGTOOLS/CHKIFS IFSDIR('/GDWEB/tmp/sshd.pid')
There's no help on that command. I did a DSPJOBLOG to figure out
existitwrote:
worked.
In case you're wondering:
Allow RTVCLSRC (CL module) . . . . . . . . . . : *NO
On Thu, Sep 5, 2024 at 11:16 AM K Crawford <kscx3ksc@xxxxxxxxx>
I am trying to verify that folder names in a control file do
onmailing
(QSYS2.IFS_OBJECT_STATISTICS('/home/myFolder/',the
IFS/mounted drive.
I can use this SQL, and it appears to work over an IFS drive.
SELECT ftpdir, c.*
FROM myLibrary.myCtrlFile c
WHERE *UPPER*(ftpdir) NOT IN
(SELECT *UPPER*(*SUBSTR*(PATH_NAME, *16*, *15*))
FROM TABLE
not'YES'
, '*ALLDIR'))
)
But my directory is a mounted drive. IFS_OBJECT_STATISTICS will
mailingworkmailing
over mounted drives.
Do I have any other options?
--
Kerwin Crawford
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
listrelated
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
questions.--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
listrelated
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
questions.
--
Kerwin Crawford
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
relatedlistrelated
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
listquestions.--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
listquestions.
--
Kerwin Crawford
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
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.