How to write a unix condition

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

How to write a unix condition

Post by pradkumar »

Hi

How to configure a condition to execute a sequence task only when there are rows in a file.

How to write a condition to execute a sequence task either when there are warning messages or when there are no warning messages in the preceding task.
Last edited by pradkumar on Thu Nov 20, 2008 5:39 pm, edited 4 times in total.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Couple of options. You can execute the UNIX command "test -s" which returns true if the file exists and has a size greater than zero. You could then "not" that or handle that appropriately in your triggers, such that only an empty / zero byte file triggers the next process.

You could also use a generic routine that leverages the DSGetLinkInfo function with the DSJ.LINKROWCOUNT InfoType to check whatever link in the job is responsible for writing to that file to see if records went down that link. Provided, of course, there is a job creating the file.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You do NOT edit your post to remove the original questions.

YELLOW CARD
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
filename.txt
Participant
Posts: 27
Joined: Thu Mar 20, 2008 11:55 am

Post by filename.txt »

ray.wurlod wrote: YELLOW CARD ...
Whats this YELLOW CARD mean ?
Thanks.

"Creativity is the ability to use your available resources to their fullest."
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The same as it means in football (soccer) and many other sports. Do it again and there will be some form of sanction imposed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why in the hell do something like that? :evil:

As to the filename question:

http://www.soccerhelp.com/Soccer_Tips_D ... html#cards
-craig

"You can never have too many knives" -- Logan Nine Fingers
filename.txt
Participant
Posts: 27
Joined: Thu Mar 20, 2008 11:55 am

Post by filename.txt »

I wish admin to edit the question(to get back the previous post) and warn the user.

The edit permissions should be taken off for the Questions after the Question gets replies, to avoid these kind of situations.
Last edited by filename.txt on Thu Nov 20, 2008 2:52 pm, edited 1 time in total.
Thanks.

"Creativity is the ability to use your available resources to their fullest."
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I disagree. Sometimes it is needful to go back to correct spelling and so forth.

What really should happen is that pradkumar should re-edit the original post and reinstate the questions that ought never to have been removed, and apologize.

Otherwise we may have to start using pratkumar as his appellation. :wink:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

Is that some mountain range on the east coast?
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Apparently, more like the small mountain range you sit on. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's where you'll all live when the Mac vs PC wars are won.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post by pradkumar »

Oh my god.. I apologize for the mistake i have done.. i dont know how it happened actually i was trying to edit the post and something messed up.. sorry for that i will never do this again..

Thanks
Pradeep Kumar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Forgiveness is yours.
:)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post by pradkumar »

Once again My Apology ... Ray Thanks for suggesting..
Post Reply