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



It works!

Thanks so much.

How do I design parmpath so it can be run from qshell?

Albert

----- Original Message -----
From: "Scott Klement" <midrange-l@xxxxxxxxxxxxxxxx>
To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
Subject: Re: Deleting a folder from the IFS
Date: Fri, 31 Aug 2007 13:34:39 -0500


Albert,

Whenever an API refers to a field as BINARY(4), it should be defined as
10I 0 in RPG. (Your code is using 4b 0, which is only 2 bytes long --
and isn't a true binary field.)

Try changing all of your '4b 0' fields in the PathData and AttribData
structure to '10i 0'.

Also, under 'PathLen' it should be the length of the path name without
any trailing spaces -- not the length of the whole field!!

Also, since ParmPath is an input parameter -- make sure you run this
with a CL command interface, since calling it via the CALL command will
have problems with a parm that large.

It might make more sense, however, if you designed ParmPath as something
that will be passed from QShell. That way, your program can be run via
the 'find' utility.


Albert York wrote:
Well, the journey continues. When I run my program I get the
error message 'The value specified for the argument is not
correct.' I'm not sure which argument is wrong but here is my
program:

* Attrib
* Turn off readonly attribute
*
D ParmPath s 256
D rc s 10i 0
D Errno S 10i 0 Based(perrno)
D ErrMsg s 256

D StrError PR * ExtProc('strerror')
D 10i 0 Value

D $$Errno PR * ExtProc('__errno')

D Attrib PR 10i 0 ExtProc('Qp0lSetAttr')
D * Value
D * Value D
10u 0 Value D
10u 0 Value
DAttribData ds D
AttribOffset 4b 0 D AttribID
4b 0 D AttribSize
4b 0 D AttribRes 4b 0
D AttribVal 1

DPathData ds D PathCCSID
4b 0 D PathCountry
2 D PathLang 3
D PathRes1 3
D PathType 4b 0 D
PathLen 4b 0 D PathDelim
2 D PathRes2
10 D Path
256
C *entry plist
C parm
ParmPath 256
C eval
AttribOffset = 0 C eval
AttribID = 17 C eval
AttribSize = 1 C eval
AttribVal = X'00' C eval
AttribRes = 0 C eval
PathCCSID = 0 C eval
PathCountry = *allx'00' C eval
PathLang = *allX'00' C eval
PathRes1 = *allX'00' C eval
PathType = 0 C eval PathLen = 256
C eval PathDelim = '/ '
C eval PathRes2 = *allx'00'
C eval Path = ParmPath

C eval rc = Attrib(%addr(PathData):
C %addr(AttribData):17:0)
C
rc iflt 0 C
eval perrno = $$Errno C
eval ErrMsg = %str(StrError(errno)) C
endif
C
move *on *inlr C
return




--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
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-Ups:

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.