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



More than likely the qtmhhttp or qtmhhtp1 user profile does not have the
authority to a: clear the file or b: execute the command.

Try adding these two variables to your program

DCommandResult    S             10I 0 Inz
DCommandCPFMSG    S              7A   Import('_EXCP_MSGID')

Then change your call from
  syscall('clrpfm gregw/fndordbydt');
to 
  CommandResult = syscall('clrpfm gregw/fndordbydt');

If Command Result is less than zero, interrogate CommandCPFMSG to find
out what error is being returned.

Bryan Yates
SR Systems Analyst/Programmer
Information Technology
Collin County Government
http://www.collincountytexas.gov
mailto:byates@xxxxxxxxxxxxxxxxxxxxx
 
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Greg Weber
Sent: Monday, May 09, 2005 5:28 PM
To: rpg400-l@xxxxxxxxxxxx
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 thread ...


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.