It is currently 19 Apr 2018 11:21


Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 11 Apr 2011 4:32 
Offline
Nouveau
Nouveau
User avatar

Joined: 11 Apr 2011 12:00
Posts: 2
Hi guys,

I succeeded to create a Job with Control M- Desktop using an "Embedded Script" (after checking the box and edit my command).
It works perfectly : I can define my own "Job name" and "File Name".

But I intend to create the same job via the ctmcreate command : this job would use the -EMBEDDED_SCRIPT.
My command line is, as instance :

Code:
ctmcreate -TASKTYPE JOB -JOBNAME TEST -EMBEDDED_SCRIPT "/tmp/bar/foo"

The return is :

Code:
ctmcreate -TASKTYPE JOB -JOBNAME TEST -EMBEDDED_SCRIPT "/tmp/bar/foo"
Output:
cannot open '/tmp/bar/foo' file. rc = 2
usage: ctmcreate
  -TASKTYPE       <JOB>
  [ -GROUP          <group> ]
  [ -APPLICATION    <applic> ]
  [ -DEBUG        <debug> ]
...
...


The problem is that the file exists and its rights are 777 ...


Thank you for your help..!


Top
   
 Post subject:
PostPosted: 14 Apr 2011 6:02 
Offline
Nouveau
Nouveau
User avatar

Joined: 11 Apr 2011 12:00
Posts: 2
No one to help me ?


Top
   
 Post subject:
PostPosted: 19 Apr 2011 4:11 
Offline
Nouveau
Nouveau
User avatar

Joined: 29 Nov 2006 12:00
Posts: 37
Location: Ile de France
Hi,

Try "ls /tmp/bar/foo"

Your command works :
ctrlm640 [15] ls -ltr /tmp/mm*
-rwxr----- 1 ctrlm640 controlm 23 Apr 19 15:59 /tmp/mm.ksh
ctrlm640 [16] ctmcreate -TASKTYPE JOB -JOBNAME TEST -EMBEDDED_SCRIPT "/tmp/mm.ksh"
new ORDER created, orderid:0004xa(6382) for JOBNAME=TEST.



Regards


Top
   
 Post subject:
PostPosted: 22 Apr 2011 3:16 
Offline
Nouveau
Nouveau
User avatar

Joined: 07 Jan 2010 12:00
Posts: 149
Largonir,

The problem is that ctmcreate does not work exactly like a job creation under Desktop.

When defining your job under Desktop, you may either edit your entire script, or load it (bottom left of the edit windows) from a file. This last option implies that your script resides in the neighbourhood of your desktop session.
When creating it using ctmcreate, the EMBEDDED_SCRIPT option will allow you to edit the script once the job has been ordered, but it is only equivalent to the “Load from file” option.
It does not allow you to enter a list of commands, which would make a script, as you can do under Desktop.

This implies that your script file must reside in the neighbourhood of the ctmcreate itself. In that case, one can question the interest of using the EMBEDDED_SCRIPT option. A regular job would do the same, with the same constraints.

Cheers
Nicolas Mulot


Top
   
PostPosted: 21 Feb 2013 11:58 
Offline
Nouveau
Nouveau
User avatar

Joined: 27 Dec 2007 12:00
Posts: 6
Hello,
I have the exact same problem as discussed here, but do not understand nicolas_mulot's answer.
What do you mean by "This implies that your script file must reside in the neighbourhood of the ctmcreate itself"?
I tried having the script in the same directory as teh ctmcreate executable, in /tmp, etc... even chmoded the script to 777 always the same result...
I then tried under Windows, again same result.
Could someone explain a bit how he went through this?
Thanks in advance,
Félix


Top
   
 Post subject:
PostPosted: 21 Feb 2013 9:52 
Offline
Nouveau
Nouveau
User avatar

Joined: 13 Jun 2007 12:00
Posts: 317
Did you invoke ctmcreate on CTM or on Agent?

Server utility invoked on Agent is actually executed at CTM. Agent UT process will connect with CTM to request for execution of utility and wait for output from CTM to be displayed at Agent.

When ctmcreate is executing at CTM, it expects the file to be a path local to CTM. The failure of "cannot open file", or to be exact "file not found" is because the utlilty is invoked at Agent with the file at Agent.


Top
   
 Post subject:
PostPosted: 22 Feb 2013 1:58 
Offline
Nouveau
Nouveau
User avatar

Joined: 27 Dec 2007 12:00
Posts: 6
@gglau: Thank you very much! I was doing my ctmcreate at the agent level, trying to embed a file on an agent's file system...
Once the file located on the CTM server, the command worked like a charm, and my job with embedded JCL has been created correctly.

I think this is not clearly indicated in BMC's documentation - or I shall have read it better...


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved