Getting JOBID in a perl script

The following article was the closest one I found when looking for scripting for CCS. I was told `new job ..` will return JOBID but not sure in what format!!- it is actually a string of 4 terms. Was not quite apparent from what was there on the example script which failed to run at the %CCS_JOBID% part (see URL below).

I came up with a hack to fix that – I think we can use scaler instead of the implicit way of coercing the string to number. So first I substr the number as string – then coerce it to number and use it! The hack I used (based on the script that uses %CCS_JOBID% at Look at the script posted on


# create new job
$id = `job new /numprocessors:4`;
# print $id;
$id = substr($id, 16,4) + 0;
# print $id;
# add parametric tasks
for ($i = 0; $i < 5 ; $i++) {
 `job add $id /stdin:\\fileshare\infile$i.txt /stdout:outfile$i.txt myapp.exe`;

`job submit /ID:$id`;

Comments (0)