IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Connect Direct


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
João Mukuno

New User


Joined: 25 May 2011
Posts: 2
Location: Brazil

PostPosted: Wed May 25, 2011 10:59 pm
Reply with quote

Hello All,

I would like to know if is possible to run a *.bat file in a Windows server using connect direct from mainframe. I don't know if I use a RUN TASK or a RUN JOB or which command to use or how can I start this *.bat file.

If does anybody know how to do please send me solution please.

If I was not clear please reply that I will try to explain again !!

Oh, I almost forgot... I tried this command below but I does not have success (The SNODE was defined before in signon process):

Code:
STEP1     RUN TASK (PGM="TEST") SNODE       -                           
          SYSOPTS=\'CMD(G:\\TSTFOL\\TST\\TEST.BAT) DESKTOP (YES)'\   


Thanks a Lot !!!
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed May 25, 2011 11:03 pm
Reply with quote

It depends.

Quote:

The Run Task statement calls external programs to run on a Connect:Direct node. The Process waits
until the external program completes before continuing. When the external program completes, the
Run Task returns a completion code that indicates program success. This completion code can be
used by subsequent Process conditional statements.

The Run Job statement executes external programs or commands to run on a Connect:Direct node.
These programs run concurrently with the Process. Unlike the Run Task statement, the Process does not wait for the program to finish.
When the Run Job statement completes, it returns a completion code. This completion code
indicates the success of the Run Job statement, and not the success of the program or command.


My personal preference is to not use either, but to rely on the job scheduling system to handle such a task. Since you want to run a command, from what I know, RUN JOB is your only option.
Back to top
View user's profile Send private message
João Mukuno

New User


Joined: 25 May 2011
Posts: 2
Location: Brazil

PostPosted: Tue Jun 14, 2011 10:09 pm
Reply with quote

Hello all,
First I would like to thanks Mr. Superk for the support and his idea...
Superk I read your message but I did the solution with another way...

Well I will Explain what I did.
I used a RUN TASK and it works fine.

First I asked to Windows responsible to configure the proxy from his side to accept my user to run the process in the windows side (This is necessary or you do not have access to run anything there).
Second I used the PGM instead CMD and did a different command as I will show below:

Code:

RUN TASK (PGM=WINNT)                                         -
SYSOPTS="PGM(TEST.BAT)" SNODE                                 


I saw in C:D guide that is necessary to know if the windows is 95 or NT in my case the windows is a windows server, but it is not a problem because windows server is like a Windows NT, this is to explain the use of the parameter (PGM=WINNT) if it was windows 95 the parameter should be (PGM=WIN95).
In the parameter SYSOPTS I used as parameter only the name of the ".bat" file once that the path just configured previously in the server.
the SNODE were configured previously in the SIGNON defining with the main path of the server in my case is a website ("SNODE=TCPNAME=WEBSITE.COM HOLD=NO").

Well I think that's all.
I hope that all this explanation has been helpful.

Thanks a lot again !!!!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Connect Direct 6.3 for Z/OS All Other Mainframe Topics 20
No new posts Getting TWA in CICS program while con... CICS 14
No new posts Unable to connect FTP over TLS from z... All Other Mainframe Topics 5
No new posts Connect:Direct Add yesterday date in ... All Other Mainframe Topics 3
No new posts FTP - connect with certificate, no pa... JCL & VSAM 1
Search our Forums:

Back to Top