Code: Select all
tags and we'll see what we can do.
Moderators: chulett, rschirm, roy
Code: Select all
tags and we'll see what we can do.
chulett wrote:I don't have a Windows server so don't have ExecDOS. Post the routine code, wrapped inCode: Select all
tags and we'll see what we can do. ...[/quote] jobName="runSSISPackageBOALoad" *Run SSIS Package DosCommand="C:\psexec\psexec -U hcf":UserID:" -p ":Password:" \\HCF15 -i dtexec /SQL \ZeroCouponLoad\BOALoad /SERVER HCF15 /CHECKPOINTING OFF /REPORTING EW" call DSU.ExecDOS(DosCommand,ErrCode); if ErrCode <> 0 Then Call DSLogFatal("DOS script failed.", jobName)
Code: Select all
SUBROUTINE HideLogPassword(InputArg,ErrorCode)
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
* Get job information
JobName = Field(DSGetJobInfo(DSJ.ME, DSJ.JOBNAME), ".", 1,1)
JobNumber = Trans("DS_JOBS", JobName, 5, "X")
JobStart = DSGetJobInfo(DSJ.ME, DSJ.JOBSTARTTIMESTAMP)
* Open the job log
LogFileName = "RT_LOG" : JobNumber
Open LogFileName To hLogFile
Then
* Generate Select List of log entries for current run
Perform "SELECT " : LogFileName : " WITH TIMESTAMP > " : SQuote(JobStart) : " TO 9"
Loop
While ReadNext EventNo From 9
* Read the logfile entry text, locking for update.
ReadVU LogEntry From hLogFile, EventNo, 10
Then
* Determine whether "psexec" occurs in entry.
If Index(LogEntry, "psexec", 1)
Then
* Extract the password from that entry.
Password = Field(LogEntry, "-p", 2 1)
Password = Left(Password, Index(Password, "\\", 1) - 1)
Password = Trim(Password)
* Replace the found password with asterisks.
LogEntry = Ereplace(LogEntry, Password, "********", 1, 1)
* Replace that line into the log.
WriteV LogEntry To hLogFile, EventNo, 10)
Else
Release hLogFile, EventNo
End
End
End
Else
Release hLogFile, EventNo
End
Repeat
Close hLogFile
End
RETURN
Which is exactly why I suggested creating a 'Silent' version of the routine that doesn't log that stuffs or since it's all custom code, switch to using DSExecute directly.ray.wurlod wrote:Because DataStage writes it there if it's an ExecXXX subroutine.