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



Hi,

Take a look at the from and to program names for the messages. In particular are the to program names your program from which you are issuing the RCVMSG?

The problem is that you are attempting to receive messages for programs that are no longer in the call stack. Unfortunately this leaves you with 2 options:
1) The "Retrieve joblog message" API
2) a. Issue a message prior to executing the batch FTP, keeping the message key (may need to RCVMSG it to do that, you may also want to disappear it as well)
b. Execute the batch FTP
c. Issue a second message after executing the batch FTP, keeping the message key (may need to RCVMSG it to do that, you may also want to disappear it as well)
d. Looping between the message keys in a & c, RCVMSG on the message key, looking for messages of interest by using %BIN on the message key. Be aware that there may (will) be gaps. Large ones. :)

Can you tell which way I've solved this sort of problem before (not batch FTP though)?

Regards,

Kevin Wright.

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of sjl
Sent: Friday, 19 August 2011 3:00 PM
To: midrange-l@xxxxxxxxxxxx
Subject: RCVMSG hell...


I am prototyping a program which does batch FTP.

[ Cannot use FTPAPI... ;-( ]

1) Bound CL program A calls RPGIV program B which builds the
FTP script in
the source file.

2) Then program A calls bound CL program C, which overrides
INPUT to the
member containing the FTP script built by program B. The FTP
script uses
MGET FILEXXX.* to get multiple files beginning with the
characters "FILEXXX"
from the remote server.

Example of the remote files being retrieved:
FILEXXX.1.A000001
FILEXXX.2.A000002
...

The result of the MGET is a file named FILEXXX in the current
library, with
two members:
A000001 and A000002.

So far, so good.

In order to capture the file and member names received, I
want to use the
RCVMSG command in CLLE program C to retrieve the completion
messages that
appear in the job log.

The specific messages in which I am interested are the
CPC7301 and CPC7305
messages issued by the FTP processor, but I cannot seem to
get it to work
properly - I never receive these completion messages in my
RCVMSG loop:

CPC7301 Completion 00 08/18/11
20:11:16.133800 QDDCPF
QSYS 0567 QC2SYS QSYS *STMT
To module . . . . . . .
. . : QC2SYS
To procedure . . . . .
. . : system
Statement . . . . . . . . . : 6
Message . . . . : File FILEXXX
created in library SJLFTP.

CPC7305 Completion 00 08/18/11
20:11:16.157120 QDDCPFM
QSYS 005B QC2SYS QSYS *STMT
To module . . . . . . .
. . : QC2SYS
To procedure . . . . .
. . : system
Statement . . . . . . . . . : 6
Message . . . . :
Member A000001
added to file FILEXXX in SJLFTP.

CPC7305 Completion 00 08/18/11
20:11:16.264264 QDDCPFM
QSYS 005B QC2SYS QSYS *STMT
To module . . . . . . .
. . : QC2SYS
To procedure . . . . .
. . : system
Statement . . . . . . . . . : 6
Message . . . . :
Member A000002
added to file FILEXXX in SJLFTP.

Does anyone have a working example of code which does
something similar?

Regards,
SJL

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.