How to track STRPCCMD errors

980 pts.
Tags:
AS/400
AS400 Cleanup V5R4M0
STRPCCMD command
Need some help with the command STRPCCMD.

I am using this command in a CL program to display a .pdf document stored on the server. The name of the document is determined by the Cl program given the user and other parameter. All works well when the document is found in correct place.  When the document is not found in the respective folder, the program just hangs.

How can I track the situation (STRPCCMD does not seem to have any error messages) where the document is not found to advise the user?



Software/Hardware used:
i-series, V5R4M0
ASKED: January 26, 2012  11:24 PM
UPDATED: August 26, 2013  4:05 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    How can I track the situation ... where the document is not found to advise the user? At least part of the problem will be that STRPCCMD running on your AS/400 will have no way to know what the result of the command on the PC is. It seems extremely likely that STRPCCMD will have to pass a path that begins with references to some network node. The expected .PDF probably won't be in a directory that is local to the PC. But the way that one system interprets a path has no required relationship to how a different system interprets the same path. A host table entry, for one obvious example, might redirect the search along a path to anywhere in the world. Some minor bug in Windows Networking (unexpected configuration, modified share-name, etc.) might initiate a Windows search that could run for a long time before ending in any kind of error status. There might be useful techniques. Can you show an actual representative example of a STRPCCMD? Tom
    125,585 pointsBadges:
    report
  • tjgm88
    Yeah sure. Here is the code for the CL pgm: PGM PARM(&INP) DCL VAR(&INP) TYPE(*CHAR) LEN(34) ere is the code for teh CL: DCL VAR(&CMD) TYPE(*CHAR) LEN(200) + VALUE('rundll32 shell32,ShellExec_RunDLL') DCL VAR(&POLPTH) TYPE(*CHAR) LEN(128) VALUE('G:Generaltemppolicy3CAN0000442. pdf') CHGVAR VAR(&CMD) VALUE(&CMD *BCAT '"' *TCAT &POLPTH + *TCAT '"') STRPCO PCTA(*NO) MONMSG IWS4010 STRPCCMD PCCMD(&CMD) PAUSE(*NO) ENDPGM
    980 pointsBadges:
    report
  • tjgm88
    Sorry, Here ti is again: PGM PARM(&INP) DCL VAR(&INP) TYPE(*CHAR) LEN(34) : DCL VAR(&CMD) TYPE(*CHAR) LEN(200) + VALUE(’rundll32 shell32,ShellExec_RunDLL’) DCL VAR(&POLPTH) TYPE(*CHAR) LEN(128) VALUE(’G:Generaltemppolicy3CAN0000442. pdf’) CHGVAR VAR(&CMD) VALUE(&CMD *BCAT ‘”‘ *TCAT &POLPTH + *TCAT ‘”‘) STRPCO PCTA(*NO) MONMSG IWS4010 STRPCCMD PCCMD(&CMD) PAUSE(*NO) ENDPGM
    980 pointsBadges:
    report
  • TomLiotta
    Sorry, Here ti is again I assume that slashes are missing. To show single slashes, they must be doubled. But don't worry about it; it looks obvious where they ought to be. It's enough to test similar code. Tom
    125,585 pointsBadges:
    report
  • tjgm88
    Take 3: (with slashes) PGM PARM(&INP) DCL VAR(&INP) TYPE(*CHAR) LEN(34) : DCL VAR(&CMD) TYPE(*CHAR) LEN(200) + VALUE(’rundll32 shell32,ShellExec_RunDLL’) DCL VAR(&POLPTH) TYPE(*CHAR) LEN(128) VALUE(’G:General//temp//policy//03CAN0000442. pdf’) CHGVAR VAR(&CMD) VALUE(&CMD *BCAT ‘”‘ *TCAT &POLPTH + *TCAT ‘”‘) STRPCO PCTA(*NO) MONMSG IWS4010 STRPCCMD PCCMD(&CMD) PAUSE(*NO) ENDPGM
    980 pointsBadges:
    report
  • TomLiotta
    DCL VAR(&POLPTH)... That variable doesn't make much sense. Is it really always a constant value? How can your CL program possibly know that the PC knows what the "G:" drive is? Why use a drive designator rather than a server name and share name? Tom
    125,585 pointsBadges:
    report
  • tjgm88
    Hi Tom, Thanks for your attempt to assist me. The code I have posted here is just a sample program. It does work but is not the final product. The drive code will be eventually replaced by proper server name. However, what I really need to know is how to determine that STRPCCMD is not finding the document in the path. When document is found, it is all okay, but when it is not, the program hangs and I am not able to detect that. I need to be able to advise user that th doc is missing. Unless I am using a wrong technique. Please advise. GM.
    980 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following