Image not found Collapse All | Expand All | Show Default


GenHtmlFromSqlDriver
DataStage Job Report
Generated 2005-02-15 08:26:49pm

 - Job Design  

Image not found

 - Job Information  

 - Job Properties (8) 

Property Value
Object Type Server 
Short Description Last Changed: 02-02-2005 
Full Description Job: GenHtmlFromSqlDriver
-------------------------------------------------------------------------------------
Non-technical description:
Generate Sql from a SQL statement.
Stores results in Sql2Html/FileName.html
-------------------------------------------------------------------------------------
Business rules:
tbd
-------------------------------------------------------------------------------------
Rules for restarting this job:
Just rerun.
-------------------------------------------------------------------------------------
Parameters:
1. FilePath
2. LogoPath
3. SqlScriptsId
4. SqlDsn
5. SqlUser
6. SqlPwd
7. DebugSw
8. EmailFlag
9. EmailTo
10. MsgJobName
11. Replacements
12. RepSeparator
13. FileName
-------------------------------------------------------------------------------------
Sources:
tbd
-------------------------------------------------------------------------------------
Targets:
tbd
-------------------------------------------------------------------------------------
Modification History:
-------------------------------------------------------------------------------------
UserId Date Version Modification Description
-------------------------------------------------------------------------------------
kduke 02-02-2005 1 Created job.
-------------------------------------------------------------------------------------
 
Category EtlStats 
Multiple Instance True 
Job Version Number 40.0.0 
Hash File Cache Sharing False 
Job Control * -----------------------------------------------------------------
* Job: GenHtmlFromSqlDriver
* -----------------------------------------------------------------
* Description:
* Generate Sql from a SQL statement.
* Stores results in Sql2Html/FileName.html
* ------------------------------------------------------------
* Parameters:
* 1. FilePath
* 2. LogoPath
* 3. SqlScriptsId
* 4. SqlDsn
* 5. SqlUser
* 6. SqlPwd
* 7. DebugSw
* 8. EmailFlag
* 9. EmailTo
* 10. MsgJobName
* 11. Replacements
* 12. RepSeparator
* 13. FileName
* -----------------------------------------------------------------
* Created by : 2004-11-29 Kim Duke
* Last Modified : 2005-01-05 by Kim. Added check parent logic.
* -----------------------------------------------------------------
JobName = "GenHtmlFromSqlDriver"
Title = 'Generate Sql from a Sql statement'
* -----------------------------------------------------------------
Now = oconv(@DATE, "D4-YMD[4,2,2]"):' ':oconv(@TIME, "MTHS")
ThisDay = convert('-','',oconv(@DATE, "D4-YMD[4,2,2]"))
NotUsed = ''
If System(91) = 0 Then
Shell = "UNIX"
Sep = '/'
OtherSep = '\'
End Else
Shell = "DOS"
Sep = '\'
OtherSep = '/'
End
convert OtherSep to Sep in LogoPath
convert OtherSep to Sep in FilePath
SqlPath = "SqlScripts"
DirName = SqlPath
* -----------------------------------------------------------------
openpath SqlPath to SqlDir else
Cmd = 'CREATE.FILE ':SqlPath:' 19'
execute Cmd capturing output
openpath SqlPath to SqlDir else
Call DSLogInfo("Error: Unable to open " : SqlPath, JobName)
goto TheEnd
end
end
* -----------------------------------------------------------------
read SqlStmt from SqlDir, SqlScriptsId else
Call DSLogWarn(SqlScriptsId:" not in ":SqlPath, "JobControl")
goto TheEnd
end
* convert char(13):char(10):@VM:@FM:@SVM to " " in SqlStmt
SqlStmt = change(SqlStmt, @FM, char(13):char(10))
Call DSLogInfo("SqlStmt: " : SqlStmt, JobName)
* -----------------------------------------------------------------
* RepSeparator = "~"
NoReps = dcount(Replacements, RepSeparator)
for i=NoReps to 1 step -1
RepStr = field(Replacements, RepSeparator, i)
SqlStmt = change(SqlStmt, ":":i, RepStr)
next i
Call DSLogInfo("SqlStmt: " : SqlStmt, JobName)
* -----------------------------------------------------------------
* Setup KgdGenSqlFromSql, run it, wait for it to finish, and test for success
* -----------------------------------------------------------------
hJob1 = DSAttachJob("GenHtmlFromSql.":FileName, DSJ.ERRFATAL)
If NOT(hJob1) Then
Call DSLogFatal("Job Attach Failed: GenHtmlFromSql", "JobControl")
Abort
End
ErrCode = DSSetParam(hJob1, "FilePath", FilePath)
ErrCode = DSSetParam(hJob1, "LogoPath", LogoPath)
ErrCode = DSSetParam(hJob1, "FileName", FileName)
ErrCode = DSSetParam(hJob1, "SqlStmt", SqlStmt)
ErrCode = DSSetParam(hJob1, "SqlDsn", SqlDsn)
ErrCode = DSSetParam(hJob1, "SqlUser", SqlUser)
ErrCode = DSSetParam(hJob1, "SqlPwd", SqlPwd)
ErrCode = DSSetParam(hJob1, "DebugSw", DebugSw)
ErrCode = DSSetParam(hJob1, "EmailFlag", EmailFlag)
ErrCode = DSSetParam(hJob1, "EmailTo", EmailTo)
ErrCode = DSSetParam(hJob1, "MsgJobName", MsgJobName)
ErrCode = DSSetParam(hJob1, "EmailHeader", SqlScriptsId:' Results')
ErrCode = DSRunJob(hJob1, DSJ.RUNNORMAL)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
If Status = DSJS.RUNFAILED Or Status = DSJS.CRASHED Then
* Fatal Error - No Return
Call DSLogFatal("Job Failed: GenHtmlFromSql", "JobControl")
End
* -----------------------------------------------------------------
TheEnd:  

 - Parameters (13) 

Parameter Name Prompt Default Value Help Text
FilePath  FilePath  ./   
LogoPath  LogoPath  OurLogo.jpg   
SqlScriptsId  SqlScriptsId  EtlRowByName.sql   
SqlDsn  SqlDsn  kduke   
SqlUser  SqlUser  etluser   
SqlPwd  SqlPwd  etluser   
DebugSw  DebugSw   
EmailFlag  EmailFlag   
EmailTo  EmailTo     
MsgJobName  JobName in email message  SeqTimeDim   
Replacements  Replacements for :1, :2 etc  TimeDim   
RepSeparator  RepSeparator like /   
FileName  FileName  TimeDim_RowHist   

 - Stages (0) 



 - Source Stages (0) 


 - Processing Stages (0) 


 - Target Stages (0) 





Ascential and DataStage are trademarks of Ascential Software Corporation or its affiliates and may be registered in the United States or other jurisdictions.
For questions or comments regarding this utility, contact tony.curcio@ascentialsoftware.com.