Page 1 of 1

JOB PARAMETER

Posted: Wed Jun 01, 2005 3:32 pm
by shrey3a
Hi,

I've job which fetches only one record in Hash/Seq file and I need to use it as a Job parameter in next job.
Its a Date filed and I need to query my source against it , I want to filter the data at source stage only by embedding the hash file value as parameter in the SQL query 'WHERE' clause.

i.e. where updated_on >= #HashFileValue#

Regards,

Regards

Posted: Wed Jun 01, 2005 5:33 pm
by ray.wurlod
The job parameter value must be obtained before you run this job.
You can create a routine to read the value from the hashed file, then use the return value from this routine in a job sequence to provide the value for the job parameter in a Job Activity.

Code: Select all

FUNCTION GetHashedFileValue(HashedFilePath,KeyValue,FieldNumber)
RoutineName = "GetHashedFileValue"
Ans = @NULL
OpenPath HashedFilePath To HF.fvar
On Error
   Call DSLogWarning('Error opening "':HashedFilePath:'".', RoutineName)
End
Then
   ReadV Result From HF.fvar, KeyValue, FieldNumber
   On Error
      Call DSTransformError('Error reading from hashed file.', RoutineName)
   End
   Then
      Ans = Result
   End
   Else
      Call DSLogWarn('Record "':KeyValue:'" not found in "':HashedFilePath:'".', RoutineName)
   End
End
Else
   Call DSLogWarn('Unable to open "':HashedFilePath:'".', RoutineName)
End
RETURN(Ans)

Posted: Wed Jun 01, 2005 8:29 pm
by sagara
Have similar question..
Is there a function through which I can get the part a file name to be my job parameter? The sequential files which are input to the jobs carry date in the filenames (and no where in the content of the file) which needs to be used in the tranforms. Any thoughts?
Thanks,
Sangeetha

Posted: Wed Jun 01, 2005 8:42 pm
by ray.wurlod
Post a new thread. We don't hijack threads - it renders the search mechanism inefficient. Yours is an almost completely different requirement.

Posted: Fri Jun 03, 2005 10:51 am
by shrey3a
Thanks Guru...Gereat Help .....Thanks Again

[quote="ray.wurlod"]The job parameter value must be obtained before you run this job.
You can create a routine to read the value from the hashed file, then use the return value from this routine in a job sequence to provide the value for the job parameter in a Job Activity.
[code]FUNCTION GetHashedFileValue(HashedFilePath,KeyValue,FieldNumber)
RoutineName = "GetHashedFileValue"
Ans = @NULL
OpenPath HashedFilePath To HF.fvar
On Error
Call DSLogWarning('Error opening "':HashedFilePath:'".', RoutineName)
End
Then
ReadV Result From HF.fvar, KeyValue, FieldNumber
On Error
Call DSTransformError('Error reading from hashed file.', RoutineName)
End
Then
Ans = Result
End
Else
Call DSLogWarn('Record "':KeyValue:'" not found in "':HashedFilePath:'".', RoutineName)
End
End
Else
Call DSLogWarn('Unable to open "':HashedFilePath:'".', RoutineName)
End
RETURN(Ans)[/code][/quote]