nQSError: 66013 Permission Denied message from agent
Hello all-
I have an issue where an agent that I previously had working was converting from tab delimited file to CSV and placing it on a file system. Now since I have moved the location where the file system resides the new machine is giving me a problem and doesn't allow the agent complete. The exact message is
[nQSError: 66013] [Line:75 Column 1]
Permission Denied
I am guessing this is an issue with the saving to the file system and perhaps some permissions.
This is the syntax of Line 75 column 1
objFSO.CopyFile Parameter(0), sFileName, True
Here is the complete file
'###======================================================================
'##
'## Purpose:
'## 1. This script takes a file from OBIEE and saves to the file system
'## 2. Creates a reporting subdirectory if not already present
'## 3. Creates a further subdirectory with name based on current date
'## 4. Converts .tsv file to true .csv
'## 5. Deletes .tsv file used in conversion process
'## Inputs (specified in Actions tab of OBIEE Delivers Agent):
'## 1. Parameter(0) - This actual file to be exported
'## 2. Parameter(1) - The filename specified within OBIEE
'## 3. Parameter(2) - Report sub directory name specified within OBIEE
'##
'###=========================================================================
Const ForReading = 1
Const ForWriting = 2
Const Unicode = -1
Dim sBasePath
sBasePath = "\\NZWLGFP01\Shared\NAV_Warehouse\RetailPro"
'NZWLGFP01\Shared\NAV_Warehouse\RetailPro"
'\\iblocal\global\integration\production\retailpro"
'"\\usesfil01\integration\production\retailpro"
Dim sMasterPath
sMasterPath = sBasePath & "\" & Parameter(2)
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
'check whether master directory exists, if not create
'Dim objMasterDir
'If Not objFSO.FolderExists(sMasterPath) Then
' Set objMasterDir = objFSO.CreateFolder(sMasterPath)
'End If
'Set objMasterDir = Nothing
'build string to get date in yyyy-mm-dd format
Dim sDate, sDateFull
sDate = Now
sDateFull = DatePart("yyyy", sDate) & "-"
'setting the month
If Len(DatePart("m", sDate))=1 Then sDateFull = sDateFull & "0" End If
sDateFull = sDateFull & DatePart("m", sDate) & "-"
'setting the day
If Len(DatePart("d", sDate))=1 Then sDateFull = sDateFull & "0" End If
sDateFull = sDateFull & DatePart("d", sDate) & "_"
'setting the hour
If Len(DatePart("h", sDate))=1 Then sDateFull = sDateFull & "0" End If
sDateFull = sDateFull & DatePart("h", sDate) '& "-"
'setting the minute
If Len(DatePart("n", sDate))=1 Then sDateFull = sDateFull & "0" End If
sDateFull = sDateFull & DatePart("n", sDate)
'setting the second
If Len(DatePart("s", sDate))=1 Then sDateFull = sDateFull & "0" End If
sDateFull = sDateFull & DatePart("s", sDate)
'Not needed for this script
'Dim sDir
'sDir = sMasterPath & "\" & sDateFull
'Dim objDir
'If Not objFSO.FolderExists(sDir) Then
' Set objDir = objFSO.CreateFolder(sDir)
'End If
'Set objDir = Nothing
Dim sFileName
sFileName = sMasterPath & "\" & Parameter(1) & "_" & sDateFull &".tsv"
objFSO.CopyFile Parameter(0), sFileName, True
sFileName1 = sMasterPath & "\" & Parameter(1) & "_" & sDateFull & ".csv"
'Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFileIN = objFSO.OpenTextFile(sFileName, ForReading, False, Unicode)
Set objFileOUT = objFSO.CreateTextFile(sFileName1, True, True)
While Not objFileIN.AtEndOfStream
strText = objFileIN.ReadLine
strNewText = Replace(strText, vbTab, ",")
objFileOUT.WriteLine (strNewText)
Wend
objFileIN.Close
objFileOUT.Close
objFSO.DeleteFile sFileName
Set objFile = Nothing
Set objFSO = Nothing
Set objFileIN = Nothing
Set objFileOUT = Nothing
How can I resolve this issue? Do I need to look into windows permission? Do I need to change the syntax? Can someone please help?