Skip to content

Powershell scripts/SQL scripts or half the battle! Need to know more about control-m STEPS coding!!

July 14, 2012

Recently I tried to take a job from a database and schedule it using control-m. It was basically a job that counts the number of files in a folder and had parameter in it stating that if there weren’t a certain number of files in the folder to send a email to the job owner notifying him files were missing. Sounds simple right. Of course it isn’t simple I am a newbie to control-m.

Luckily I work with very talented colleagues. They specialize in a number of things in the database world. Immediately we realized that setting up a filewatcher job with control-m will not allow you to count files. It only lets you know when a file or multiple files are created or deleted. Then the filewatcher gives you to the options to kick off another task. We didn’t want that in this particular case. We just wanted to be able to count the files in this folder and fail the job if it doesn’t have the minium number specified.

After getting frustrated my talented boss made a nice SQL script to do a count. That worked but it still wasn’t what we wanted. He then created a nice powershell script. It counted the files but yet it still wasn’t what we wanted. We want to know how to make BMC recognize that the file count is less than what it is suppose to be and then fail and give off a exit code. Is there a way to tell control-m using the steps selection if there aren’t the proper number of files  in the folder to fail “notok” and then send a email. That’s where I am today with the scheduler. Trying to learn more about the steps. So far with the steps selection I know how to code a shout to send email for a job ok or for a job failure not ok. And I do know I am in the company of talented coders that can make whatever script I ask for but I want to find more about control-m and what the steps selection is capable of . How is it involved instead of scripting everything in powershell script or a SQL script. Slow progess is progress with control-m. Signing off

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: