Wednesday, December 18, 2013

Using Script in Run Task for C:D that will kick off Control-M ctmorder

www.unixbabuforum.inWould like to execute Script out of Mainframe C:D (Connect Direct) that will do a ctmorder out of Control-M distributed. The script would contain parms containing the file name and table name. What would this look like? We tested w/ hardcoded command but it is an extremely long command and would hate to have our clients to have to enter this in their process. I have done some unix scripting and basic scripting but not sure how scripts are executed out of C:D.


www.unixbabuforum.inYou need to use the submit and run commands within the direct/ndmcli application. I cannot help with the mainframe side but here is part of a program that we use to test whether C:D is working between two hosts. The complete program runs on host1, transfers itself to host2, then sends an e-mail from the second host to confirm that it ran. 

e.g. 
su - cdadm -c ndmcli <<-EOF > $tmpFile 2>&1 

submit TestTran process SNODE=$destHost SNODEID=(cdadm,$cdpass) 

step1 
copy from (file=$locn PNODE) 
to (file=/tmp/$filename SNODE) 
step2 
run job snode 
sysopts="chmod x /tmp/$filename" 
step3 
run job snode 
sysopts="/tmp/$filename $destHost $sendHost $email" 
pend; 
EOF 

Explanation: cdadm is the CD admin, so su to this user to gain correct PATH variable, and ability to use CD. The <<-EOF means that the following code is a "here document" used as the input program to the ndmcli (C:D) process. 

The "submit" is to submit an ndmcli process, you will need to define the $desthost variable and the cdadm password in the $cdpass variable. 

The copy step will copy the program from primary to secondary node (hosts). 

The "run job" on secondary node makes the file runnable. 

The step 3 "run job" runs the program on the secondary (remote) node to send the e-mail.




0 comments:

Post a Comment

 
Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM