|
well, user that run under CGI pgm is QTMHHTP1 or QTMHHTTP and have perhaps not the rights to the file you are clearing. (you can run cgi with other user it depênd on your http config. Try to cimpile the Main PGm (with the syscal) with USRPRF(*OWNER) so it will run with owner of the pgm rights basically CGI and other pgm are the same. Hope this help ----- Original Message ----- From: "Greg Weber" <gweber@xxxxxxxxxxxx> To: <rpg400-l@xxxxxxxxxxxx> Sent: Tuesday, May 10, 2005 12:28 AM Subject: How to CLRPFM in CGI program? > I need to clear a physical file at a certain point in an RPGLE program > that uses CGIDEV2 and I'm having a tough time getting it to work. > Here's the code I've tried (all free format): > > syscall('clrpfm gregw/fndordbydt'); > and > syscall('clrpfm file(gregw/fndordbydt)'); > > Then a co-developer theorized that perhaps you can't use the clrpfm > command from inside a CGI job, so I wrote a batch program that does it > and called it from a command line. It works great. Then I tried to > call THAT program from within my CGI program, but no joy. Here's what I > tried (the batch program has the same name as the file it's clearing): > > syscall('call gregw/fndordbydt'); > and > syscall('call pgm(gregw/fndordbydt)'); > > Then I tried it this way, and it STILL wouldn't work: > > syscall('sbmjob cmd(call pgm(gregw/fndordbydt)'); > and > Cmd = 'sbmjob cmd(call pgm(gregw/fndordbydt) parm(''' + > '''))'; > syscall(%trim(Cmd)); > > There are no parameters to pass, so I left the "parm" off and then tried > it with "parm" blank. The CGI program doesn't fail, and there are no > compile errors, but both the clrpfm and the call pgm commands simply > don't do anything, no matter where I do the syscall within the program. > What's wrong? Thanks. > > -- > 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 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.