This is the requirement:
If table A's record count is 0, don't run job.
I am running Job_A, which loads data into Table_A. Job_B will load data from Table_A into Table_B by truncate and insert. If Table_A is empty, Table_B will be truncated and 0 records will be inserted.
I am trying to get the record count of Table_A and use it as a User Variable in a nested condition.
If count(*) of Table_A > 0 then run Job_B
Thanks for the info. I have not worked with any server jobs, as I'm very new to DataStage. How would I set the UserStatus to the count of a table? I've been looking on this forum, and read about using a transformer, but no real detail on how the mechanics of how this is done.
It's been discussed quite a bit so there's a lot to wade through when you search for it. I've found a fairly representative example in this post. If that all gets too complicated, you could always simply write the count to a flat file and then use something to read it back into the sequence job... in UNIX you could cat the file while in Windows a type would do it. You could do that in a custom routine or straight up in an Execute Command stage. Many ways to skin this cat.
-craig
"You can never have too many knives" -- Logan Nine Fingers
If you've just loaded it and can use the link row count from the load job, then that works. I was thinking you wanted to check a table and that a single count of the records in the table would be a way to go.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Originally, I wanted to do an actual count of Table_A on the database, but I'm limited on time. This routine can check if any records were inserted into Table_A daily. It's no where near perfect, but will get the job done.