Can we assign DS functions like DSAttachJob, DSGetLinkInfo, DSGetJobInfo, etc to Stage Variables? I'm trying to assign but the Stage Variable derivation always stays RED.
Any idea why this is happening? Any help is very much appreciated.
I have a bunch of jobs for a process. I have sequenced these jobs in a sequencer. The first two jobs access two different tables from MS-SQL server. So, normally the process finishes creating the output flat-file with a Date and TimeStamp in the output filename.
If either of the table has the required data, the output file has the regular processed data. But if both the tables have no required data, then I should create the same output file in the above format, but with this text "NO DATA TODAY" in it.
So, for achieving this, I thought I would access the row counts of the first two jobs ( the ones which access the table through ODBC). Using these row counts in the stage variables of the job where I create the output file with the date and timestamp, I'm thinking that i could hard code "NO DATA TODAY" into the output file.
That is the whole reason behind it. Please let me know your valuable opinions and suggestions. Thanks much,
You cannot use these routines in this fashion. DSAttachJob requires passing of a job NAME while DSGetLinkInfo requirs passing a job HANDLE. I think what you want to do is this:
Easy to do in a custom routine or in a shell script. In a BASIC routine you open the file, read the first line, if there is no data to be found then you write out your "DO DATA TODAY" and close it. Call it from a sequence job via a routine stage that follows the job activity stages.