0

I have a VB.net application which imports a file called resource_NAMEOFEXE.txt and when my stream Reader takes in just "resource_NAMEOFEXE.txt" as location it assume local, im guessing, and reads the file correctly when ran by user.

Then I tried running a jcl job that is supposed to run the exe the program cannot find the local path automatically. So I tried hardcoding the local path into the exe itself, and both jcl run and user run the program imported correctly. Note: the jcl is on a mainframe, the exe is on a server.

  //SFARENAM EXEC P2CUCMD                                          
  //SCRIPT   DD *                                                  
  "\\<serverName>\$APPLE\testAndRename.exe"     
  /*                                                               
  //UCMDOPT  DD DISP=SHR,DSN=IC.D2C.UCMDOPT.FILE(UZAO0001)         
//SYSIN    DD *                                                  
 -s       SCRIPT                                                 
   -host    <servername>                        
 -userid  <userid>                                      
 -script  SCRIPT                                                 
 -x       UCMDOPT                                                
 /*                                                               
//SYSOUT   DD  SYSOUT=*                                          
 //SYSPRINT DD  SYSOUT=*                                          
 //   

Could this be a JCL issue, or should I format the vb.net location in a special way to ask for local exe location.

Peter P
  • 289
  • 1
  • 5
  • 17
  • It sounds like the application is just looking in the current "working directory" for the shell context in which it's run. When "double-clicking" on it, that working directory is the current directory, which I'm guessing is where the file is located. When scripting it, the working directory for the shell context of that script could be anything. I would recommend that the application defaults to what it currently defaults to, but accepts a command-line parameter to specify the file (overriding the default). Then any scripting of the application can supply that parameter if it needs to. – David May 23 '12 at 21:04
  • What is P2CUCMD? This is not an IBM-distributed proc with which I am familiar. The most important things we need is what is the PGM= and what product this is. David is probably also on the right path, as current directory issues can crop up when executing scripts via BPXBATCH, when the RACF HOME setting can come into play. – zarchasmpgmr May 25 '12 at 13:11

1 Answers1

0

Try using the local path when calling the .exe file instead of the network path.

For example, instead of:

\\\serverName\$APPLE\testAndRename.exe

Use:

C:\something\somewhere\testAndRename.exe
Barry Michael Doyle
  • 9,333
  • 30
  • 83
  • 143