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
JOB PARAMETER
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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]
[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]