Monday, March 28, 2011

SBL-EIM-00205: NULL target table for relation!

IssueDescription:
When executing an EIM procress you get the error: SBL-EIM-00205: NULL target table for relation! followed by the error SBL-EIM-00205: Failed to load the application dictionary.

In your EIM log file (log level set to 5) you can see the following:

EIMTrace EIMTraceSubEvent 3 000000064d8a14b8:0 2011-03-24 10:25:14 3/24/11 10:25 Error SBL-EIM-00205: NULL target table for relation!

EIMTrace EIMTraceSubEvent 3 000000064d8a14b8:0 2011-03-24 10:25:15 3/24/11 10:25 Error SBL-EIM-00205: Failed to load the application dictionary.

GenericLog GenericError 1 000000064d8a14b8:0 2011-03-24 10:25:15 (compmain.cpp (1565) err=65741 sys=0) SBL-EIM-00205: Failed to load the application dictionary.

GenericLog GenericError 1 000000064d8a14b8:0 2011-03-24 10:25:15 (smisched.cpp (894) err=65741 sys=0) SBL-EIM-00205: Failed to load the application dictionary.


Cause:
In this case, the above error was obtained due to a case insensitive column that had been mapped on an EIM table involved in the EIM process.  The case insensitive columns do not exist on the database and hence the above-mentioned error occurs during EIM execution.


Issue resolution:

Try the following to resolve the issue:
1) Please try deleting/inactivating the corresponding case insensitive columns under EIM table.
2) Delete the corresponding attribute mappings in Tools under the EIM table.
3) Delete diccache.dat file from SiebSrvr\Bin directory.
4) Try running the EIM job again

Sunday, March 20, 2011

Copying a datagridview

The function below will make a copy of a datagridview.  Its in C#.


private void copyDGV(DataGridView dgvOriginal, DataGridView dgvCopy)


{

dgvCopy.Columns.Clear();

//dgvCopy.Rows.Clear();



// copy columns

foreach (DataGridViewColumn col in dgvOriginal.Columns)

{

dgvCopy.Columns.Add((DataGridViewColumn)col.Clone());

}


// copy data

DataGridViewRow dgvr = new DataGridViewRow();



for (int k = 0; k < dgvOriginal.Rows.Count; k++)

{

dgvr = (DataGridViewRow)dgvOriginal.Rows[k].Clone();

int nColIndex = 0;

while (nColIndex < dgvr.Cells.Count)

{

dgvr.Cells[nColIndex].Value = dgvOriginal.Rows[k].Cells[nColIndex].Value;

nColIndex++;

}



dgvCopy.Rows.Add(dgvr);

}


// update scrollbars
if (dgvCopy.RowCount > 0)

{

dgvCopy.UpdateRowHeightInfo(0, true);

}



dgvCopy.Refresh();

}

Wednesday, March 16, 2011

Calling an informatica workflow in a loop - Part 2

Please find Script Two below.  It is the script which is responsible for calling the workflow in a loop.

Script two:

 ::


:: Project : INTERFACES

:: Purpose : Ensures that files are processed one by one if multiple files are present in source folder

:: Author : allispossibleteam

:: Date Started : 14 May 2010

:: Date Completed: 25 May 2010

:: Usage : loopWorkflow.bat INTERFACE_CODE WORKFLOW_NAME MAX_NUM_OF_FILES EXTENSION_SOURCE_FILES

::





::@ ECHO OFF

SetLocal EnableDelayedExpansion



::

:: Interface Code (Received as parameter 1)

::

SET INTERFACE_CODE=%1



::

:: Workflow to execute (received as parameter 2)

::

SET WORKFLOW_NAME=%2



::

:: MAX number of files that will be allowed to be executed during one run of the bat file (RECEIVED AS PARAMETER 3) (SEND 0 [zero] FOR NO LIMITS)

::

SET MAX_NUM_OF_FILES=%3



::

:: Extension of source file (received as parameter 4)

::

SET EXTENSION_SOURCE_FILES=%4



::

:: INFORMATICA USERNAME, PASSWORWORD, SERVER IP, PORT NUMBER, FOLDER NAME CONTAINING MAPPING

::

SET INFY_USERNAME=Administrator

SET INFY_PASSWORD=Administrator

SET INFY_SERVER_IP=x.x.x.x

SET INFY_PORT_NUM=4001

SET INFY_FOLDER=XXXX



::

:: Path where log files are generated

::

SET PATH_OF_BATCH_FILE=E:\LOGS



::

:: Path containing the source file(s)

::

SET PATH_OF_SOURCE_FILES=E:\SOURCE_FILE





::

:: eXPECTED sOURCE fILE NAME FORMAT

::

SET SOURCE_FILE_NAME_FORMAT=%INTERFACE_CODE%_*.%EXTENSION_SOURCE_FILES%



::

:: Path for Temporary Folder where Source Files are copied

::

SET PATH_OF_SOURCE_FILES_TEMP=%PATH_OF_SOURCE_FILES%\TEMP_%INTERFACE_CODE%_CREATED_BY_BATFILE



::

:: Path and Name of Logfile

::

SET LOG_FILE=%PATH_OF_BATCH_FILE%\%INTERFACE_CODE%_LOOP_LOG.txt



::

:: Path for backup folder [Not used anymore - functionality disabled]

::

::SET BACKUP_FOLDER=%PATH_OF_SOURCE_FILES%\TEMP_BACKUP_%INTERFACE_CODE%_FILES_CREATED_BY_BATFILE



::

:: TO Allow workflow to execute even if previously it failed, PUT ANY OTHER CHARACTER EXCEPT CHARAcTER 'N'

::

SET ALLOW_WORKFLOW_TO_EXECUTE_WITH_PREVIOUS_STATUS_FAILED=N



::

:: To allow execution of workflow for other files even if workflow fails with one file, PUT ANY OTHER CHARACTER EXCEPT CHARAcTER 'N'

::

SET CONTINUE_EXECUTION_ON_WRKF_FAILURE=N



::

:: To enable prompting if overwriting an existing file in PATH_OF_SOURCE_FILES_TEMP, PUT ANY OTHER CHARACTER EXCEPT CHARAcTER 'N'

::

SET ENABLE_PROMPTING_IF_OVERWRITING=N



::

:: Time to wait (in Seconds) before startING workflow after file has been copied in the proper folder. This is to give sufficient time for file to be copied

::

SET TIME_TO_WAIT_B4_EXECUTING_WRKF=15



::

::====================== Set Variables above this line. Do NOT modify any code below this line. ==================================

::



::

:: Get todays date and place it in DAY, MONTH(numeric 01,02,03..12), MONTHN(Jan, Feb...Dec), YEAR(2007,2008, ...)

::

SET MYDATE=%date%

FOR /F "tokens=1-4 delims=/ " %%a in ("%MYDATE%") do (

SET DAY=%%c

SET MONTH=%%b

SET YEAR=%%d

)

SET TODAY=%YEAR%%MONTH%%DAY%



IF %MONTH%==01 SET MONTHN=Jan

IF %MONTH%==02 SET MONTHN=Feb

IF %MONTH%==03 SET MONTHN=Mar

IF %MONTH%==04 SET MONTHN=Apr

IF %MONTH%==05 SET MONTHN=May

IF %MONTH%==06 SET MONTHN=Jun

IF %MONTH%==07 SET MONTHN=Jul

IF %MONTH%==08 SET MONTHN=Aug

IF %MONTH%==09 SET MONTHN=Sep

IF %MONTH%==10 SET MONTHN=Oct

IF %MONTH%==11 SET MONTHN=Nov

IF %MONTH%==12 SET MONTHN=Dec



::

:: LOG START OF EXECUTION OF BATCH FILE AND ECHO TO SCREEN AS WELL

::

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Starting execution of batch file and hoping for its successful completion..............

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Starting execution of batch file and hoping for its successful completion..............





::

:: ERROR CHECK; Check if we have all required input parameters

::

IF %1.==. GOTO MISSING_PARAM_1

IF %2.==. GOTO MISSING_PARAM_2

IF %3.==. GOTO MISSING_PARAM_3

IF %4.==. GOTO MISSING_PARAM_4



::

:: ERROR CHECK; CHECK IF WORKFLOW HAD FAILED PREVIOUSLY

::

FOR /F "TOKENS=3 DELIMS=:[]" %%G IN ('pmcmd getworkflowdetails -s %INFY_SERVER_IP%:%INFY_PORT_NUM% -u %INFY_USERNAME% -p %INFY_PASSWORD% -f %INFY_FOLDER% %WORKFLOW_NAME% ^
find "Workflow run status:"') DO SET WORKFLOW_PREVIOUS_STATUS=%%G



IF %ALLOW_WORKFLOW_TO_EXECUTE_WITH_PREVIOUS_STATUS_FAILED%==N IF %WORKFLOW_PREVIOUS_STATUS%.==Failed. GOTO WORKFLOW_PREVIOUS_STATUS_FAILED



::

:: ERROR CHECK; CHECK IF SOURCE PATH EXISTS PATH_OF_SOURCE_FILES EXISTS

::

IF NOT EXIST %PATH_OF_SOURCE_FILES% GOTO PATH_OF_SOURCE_FILES_NOT_FOUND



::

:: cHECK IF PROMPTING REQUESTED B4 OVERWRITING FILE

::

IF %ENABLE_PROMPTING_IF_OVERWRITING%==N (

SET PROMPT_OPTION=Y

) ELSE (

SET PROMPT_OPTION=-Y

)



::

:: COPY ALL FILES FOUND IN PATH_OF_SOURCE_FILES TO PATH_OF_SOURCE_FILES_TEMP

::

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Moving All Files from %PATH_OF_SOURCE_FILES% to %PATH_OF_SOURCE_FILES_TEMP%

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Moving All Files from %PATH_OF_SOURCE_FILES% to %PATH_OF_SOURCE_FILES_TEMP%

FOR %%a in (%PATH_OF_SOURCE_FILES%\*.*) do (

>>%LOG_FILE% XCOPY "%%a" "%PATH_OF_SOURCE_FILES_TEMP%"\ /Z /I /H /K /%PROMPT_OPTION%

)



::

:: Delete copied Files

::

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Deleting All Files in %PATH_OF_SOURCE_FILES%

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Deleting All Files in %PATH_OF_SOURCE_FILES%

>>%LOG_FILE% DEL %PATH_OF_SOURCE_FILES%\*.* /Q



::

:: This variable counts total number of files loaded

::

SET TOTAL_FILES_LOADED=0



::

:: Used in case new files came in while the workflow was executing to allow the new files as well to be loaded. should be b4 the loop calling the workflow

::

:FOLDER_CHANGED_REDO



::

:: Call workflow for each file in directory PATH_OF_SOURCE_FILES_TEMP (HEART OF THE BAT FILE IS IN THIS LOOP, so handle with care please)

::

SET RETURNCODE=0

FOR %%a in (%PATH_OF_SOURCE_FILES_TEMP%\%SOURCE_FILE_NAME_FORMAT%) do (

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Moving any new Files from %PATH_OF_SOURCE_FILES% to %PATH_OF_SOURCE_FILES_TEMP%

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Moving any new Files from %PATH_OF_SOURCE_FILES% to %PATH_OF_SOURCE_FILES_TEMP%

SET FILE_COUNTER=0

FOR %%b in (%PATH_OF_SOURCE_FILES%\*.*) do (

>>%LOG_FILE% XCOPY "%%b" "%PATH_OF_SOURCE_FILES_TEMP%"\ /Z /I /H /K /%PROMPT_OPTION%

SET /a FILE_COUNTER=!FILE_COUNTER!+1

)

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Deleting All Files in %PATH_OF_SOURCE_FILES%

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Deleting All Files in %PATH_OF_SOURCE_FILES%

>>%LOG_FILE% DEL %PATH_OF_SOURCE_FILES%\*.* /Q

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] !FILE_COUNTER! new Files were found in %PATH_OF_SOURCE_FILES% and copied to %PATH_OF_SOURCE_FILES_TEMP%

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] !FILE_COUNTER! new Files were found in %PATH_OF_SOURCE_FILES% and copied to %PATH_OF_SOURCE_FILES_TEMP%

IF NOT !FILE_COUNTER!==0 GOTO FOLDER_CHANGED_REDO

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] About to move one file from %PATH_OF_SOURCE_FILES_TEMP% to %PATH_OF_SOURCE_FILES% and starting workflow

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] About to move one file from %PATH_OF_SOURCE_FILES_TEMP% to %PATH_OF_SOURCE_FILES% and starting workflow

>>%LOG_FILE% XCOPY "%%a" "%PATH_OF_SOURCE_FILES%"\ /Z /I

>>%LOG_FILE% DEL "%%a" /Q

:FILE_NOT_YET_DELETED

IF EXIST "%%a" GOTO FILE_NOT_YET_DELETED

CHOICE /T %TIME_TO_WAIT_B4_EXECUTING_WRKF% /D y

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Starting execution of workflow %WORKFLOW_NAME% with source file "%%a" ...

@ECHO Starting execution of workflow %WORKFLOW_NAME% with source file "%%a" ...

>>%LOG_FILE% pmcmd startworkflow -s %INFY_SERVER_IP%:%INFY_PORT_NUM% -u %INFY_USERNAME% -p %INFY_PASSWORD% -f %INFY_FOLDER% -nowait %WORKFLOW_NAME%

>>%LOG_FILE% pmcmd waitworkflow -s %INFY_SERVER_IP%:%INFY_PORT_NUM% -u %INFY_USERNAME% -p %INFY_PASSWORD% -f %INFY_FOLDER% %WORKFLOW_NAME%

SET RETURNCODE=!ERRORLEVEL!

IF ERRORLEVEL 1 IF %CONTINUE_EXECUTION_ON_WRKF_FAILURE%==N GOTO EXITLOOP

SET /a TOTAL_FILES_LOADED=!TOTAL_FILES_LOADED!+1

IF !MAX_NUM_OF_FILES! GTR 0 (

IF !TOTAL_FILES_LOADED!==!MAX_NUM_OF_FILES! (

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] MAX_NUM_OF_FILES[!MAX_NUM_OF_FILES!] has already been loaded. Exiting...

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] MAX_NUM_OF_FILES[!MAX_NUM_OF_FILES!] has already been loaded. Exiting...

GOTO EXITLOOP

)

)

)



::

:: Ensures cleanup scripts are executed in case of failure during execution of workflow

::

:EXITLOOP



::

:: ====================== FUNCTIONALITY REMOVED BELOW ==============================================================================================

::

:: DESC of OLD FUNCTIONALITY : Originally all files from source folder were being copied to the temp folder. After execution of the 'HEART' loop above,

:: if files remained in the temp folder, they were copied to a backup folder and the temp folder was deleted.

::

:: NEW FUNCTIONALITY: After execution of 'HEART' loop, if any files still remain in the temp folder, they are left there and the next time the interface is

:: is run, these files are run if they meet the proper file format

::



::

:: Copy any files remaining in %PATH_OF_SOURCE_FILES_TEMP% to %BACKUP_FOLDER%

::

::>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Copying any files remaining in %PATH_OF_SOURCE_FILES_TEMP% to %BACKUP_FOLDER%

::@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Copying any files remaining in %PATH_OF_SOURCE_FILES_TEMP% to %BACKUP_FOLDER%

::FOR %%a in (%PATH_OF_SOURCE_FILES_TEMP%) do (

::>>%LOG_FILE% XCOPY "%%a" "%BACKUP_FOLDER%"\ /Z /I /H /E /K /Y

::)

::

::

:: DELETING the DIRECTORY PATH_OF_SOURCE_FILES_TEMP

::

::>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Deleting temporary directory %PATH_OF_SOURCE_FILES_TEMP%

::@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Deleting temporary directory %PATH_OF_SOURCE_FILES_TEMP%

::RMDIR /S /Q %PATH_OF_SOURCE_FILES_TEMP%



::

:: ====================== FUNCTIONALITY REMOVED ABOVE ==============================================================================================

::



::

:: cHECK IF ERRORS OCCURED DURING EXECUTION OF WORKFLOWS AND LOG CORRESPONDING ERROR

::

@ECHO RETURNCODE IS %RETURNCODE%

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] RETURNCODE IS %RETURNCODE%

IF NOT %RETURNCODE%.==0. GOTO LEVEL%RETURNCODE%



::

:: No Errors occured. Skip error logging

::

GOTO END_OF_SCRIPT



::

:: Error Logging in case required parameters are missing OR Workflow failed

::

:MISSING_PARAM_1

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Missing Parameter 1; USAGE loopWorkflow.bat INTERFACE_CODE WORKFLOW_NAME MAX_NUM_OF_FILES EXTENSION_SOURCE_FILES

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Missing Parameter 1; USAGE loopWorkflow.bat INTERFACE_CODE WORKFLOW_NAME MAX_NUM_OF_FILES EXTENSION_SOURCE_FILES

GOTO END_OF_SCRIPT



:MISSING_PARAM_2

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Missing Parameter 2; USAGE loopWorkflow.bat INTERFACE_CODE WORKFLOW_NAME MAX_NUM_OF_FILES EXTENSION_SOURCE_FILES

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Missing Parameter 2; USAGE loopWorkflow.bat INTERFACE_CODE WORKFLOW_NAME MAX_NUM_OF_FILES EXTENSION_SOURCE_FILES

GOTO END_OF_SCRIPT



:MISSING_PARAM_3

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Missing Parameter 3; USAGE loopWorkflow.bat INTERFACE_CODE WORKFLOW_NAME MAX_NUM_OF_FILES EXTENSION_SOURCE_FILES

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Missing Parameter 3; USAGE loopWorkflow.bat INTERFACE_CODE WORKFLOW_NAME MAX_NUM_OF_FILES EXTENSION_SOURCE_FILES

GOTO END_OF_SCRIPT



:MISSING_PARAM_4

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Missing Parameter 4; USAGE loopWorkflow.bat INTERFACE_CODE WORKFLOW_NAME MAX_NUM_OF_FILES EXTENSION_SOURCE_FILES

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Missing Parameter 4; USAGE loopWorkflow.bat INTERFACE_CODE WORKFLOW_NAME MAX_NUM_OF_FILES EXTENSION_SOURCE_FILES

GOTO END_OF_SCRIPT



:WORKFLOW_PREVIOUS_STATUS_FAILED

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; %WORKFLOW_NAME% had failed in its previous run. To allow the workflow to execute even if the workflow had failed in its previous run, set the flag ALLOW_WORKFLOW_TO_EXECUTE_WITH_PREVIOUS_STATUS_FAILED to any other character except 'N' in the batch file.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; %WORKFLOW_NAME% had failed in its previous run. To allow the workflow to execute even if the workflow had failed in its previous run, set the flag ALLOW_WORKFLOW_TO_EXECUTE_WITH_PREVIOUS_STATUS_FAILED to any other character except 'N' in the batch file.

GOTO END_OF_SCRIPT



:PATH_OF_SOURCE_FILES_NOT_FOUND

@ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The path %PATH_OF_SOURCE_FILES% was not found!!!

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The path %PATH_OF_SOURCE_FILES% was not found!!!

GOTO END_OF_SCRIPT



:LEVEL1

@echo The PowerCenter Server is down, or pmcmd cannot connect to the PowerCenter Server. The TCP/IP host name or port number or a network problem occurred.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The PowerCenter Server is down, or pmcmd cannot connect to the PowerCenter Server. The TCP/IP host name or port number or a network problem occurred.

GOTO END_OF_SCRIPT



:LEVEL2

@echo The specified task name, workflow name, or folder name does not exist.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The specified task name, workflow name, or folder name does not exist.

GOTO END_OF_SCRIPT



:LEVEL3

@echo An error occurred in starting or running the workflow or task.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; An error occurred in starting or running the workflow or task.

GOTO END_OF_SCRIPT



:LEVEL4

@echo Usage error. You passed the wrong parameters to pmcmd.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Usage error. You passed the wrong parameters to pmcmd.

GOTO END_OF_SCRIPT



:LEVEL5

@echo An internal pmcmd error occurred. Contact Informatica Technical Support.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; An internal pmcmd error occurred. Contact Informatica Technical Support.

GOTO END_OF_SCRIPT



:LEVEL6

@echo An error occurred while stopping the PowerCenter Server. Contact Informatica Technical Support.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; An error occurred while stopping the PowerCenter Server. Contact Informatica Technical Support.

GOTO END_OF_SCRIPT



:LEVEL7

@echo You used an invalid username or password.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; You used an invalid username or password.

GOTO END_OF_SCRIPT



:LEVEL8

@echo You do not have the appropriate permissions or privileges to perform this task.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; You do not have the appropriate permissions or privileges to perform this task.

GOTO END_OF_SCRIPT



:LEVEL9

@echo The connection to the PowerCenter Server timed out while sending the request.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The connection to the PowerCenter Server timed out while sending the request.

GOTO END_OF_SCRIPT



:LEVEL12

@echo The PowerCenter Server cannot start recovery because the session or workflow is scheduled, suspending, waiting for an event, waiting, initializing, aborting, stopping, disabled, or running.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The PowerCenter Server cannot start recovery because the session or workflow is scheduled, suspending, waiting for an event, waiting, initializing, aborting, stopping, disabled, or running.

GOTO END_OF_SCRIPT



:LEVEL13

@echo The username environment variable is not defined.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The username environment variable is not defined.

GOTO END_OF_SCRIPT



:LEVEL14

@echo The password environment variable is not defined.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The password environment variable is not defined.

GOTO END_OF_SCRIPT



:LEVEL15

@echo The username environment variable is missing.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The username environment variable is missing.

GOTO END_OF_SCRIPT



:LEVEL16

@echo The password environment variable is missing.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The password environment variable is missing.

GOTO END_OF_SCRIPT



:LEVEL17

@echo Parameter file does not exist.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Parameter file does not exist.

GOTO END_OF_SCRIPT



:LEVEL18

@echo The PowerCenter Server found the parameter file, but it did not have the initial values for the session parameters, such as $input or $output.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The PowerCenter Server found the parameter file, but it did not have the initial values for the session parameters, such as $input or $output.

GOTO END_OF_SCRIPT



:LEVEL19

@echo The PowerCenter Server cannot start the session in recovery mode because the workflow is configured to run continuously.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The PowerCenter Server cannot start the session in recovery mode because the workflow is configured to run continuously.

GOTO END_OF_SCRIPT



:LEVEL20

@echo A repository error has occurred. Please make sure that the Repository Server and the database are running and the number of connections to the database is not exceeded.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; A repository error has occurred. Please make sure that the Repository Server and the database are running and the number of connections to the database is not exceeded.

GOTO END_OF_SCRIPT



:LEVEL21

@echo PowerCenter Server is shutting down and it is not accepting new requests.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; PowerCenter Server is shutting down and it is not accepting new requests.

GOTO END_OF_SCRIPT



:LEVEL22

@echo The PowerCenter Server cannot find a unique instance of workflow/session you specified. Enter the command again with the folder name and workflow name.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; The PowerCenter Server cannot find a unique instance of workflow/session you specified. Enter the command again with the folder name and workflow name.

GOTO END_OF_SCRIPT



:LEVEL23

@echo There is no data available for your request.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; There is no data available for your request.

GOTO END_OF_SCRIPT



:LEVEL24

@echo Out of memory.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Out of memory.

GOTO END_OF_SCRIPT



:LEVEL25

@echo Command is cancelled.

>>%LOG_FILE% ECHO [%DAY% %MONTHN% %YEAR% %TIME%] Execution ABORTED; Command is cancelled.

GOTO END_OF_SCRIPT





:END_OF_SCRIPT



::

:: Draw a line in log file to seperate it from logs of next run

::

>>%LOG_FILE% ECHO ===========================================================================================================================================================

EndLocal

@ ECHO ON

Saturday, March 12, 2011

Calling an informatica workflow in a loop - Part 1

Issue Description: We had an informatica workflow which had a flat file as source.  We could have more than one file available at one time to be loaded.  The files had to be processed individually by the workflow. 

Issue Resolution: Two batch scripts were created.  The first (See Script One below) one had to ensure that only one file was picked up by the workflow at one time.  The script is such that the number of files allowed to be processed simultaneously was passed as parameter to the script. 
Also, it ensured that zero bytes file were not processed by the informatica workflow if we so desired.  The second batch script (See Script Two in Part 2 of this post) called the workflow in a loop.  This script has other features such as: error checks and detection of status of workflow from previous run. 

Script One:

 ::


:: Project : Self-Development
:: Purpose : Checks number of files and file size before they are processed by interface

:: Author : allispossibleteam

:: Date Started : 31 August 2010

:: Date Completed: 31 August 2010

:: Usage : checkFileSize.bat INTERFACE_CODE MAX_NUM_OF_FILES

::



@ ECHO on

SetLocal EnableDelayedExpansion



::

:: Interface code received as parameter one

::

SET INTERFACE_CODE=%1



::

:: MAX number of files allowed to be interfaced comes as parameter 2

::

SET MAX_NUM_FILES_ALLOWED=%2



::

:: Flag to indicate if we want to check number of files being interfaced

::

SET CHECK_NUM_OF_FILES=Y





::

:: Path containing source files

::

SET TGTDIR=xxx\%INTERFACE_CODE%



::

:: Flag to indicate if we want to fail interface if zero byte file is found

::

SET FAIL_ON_ZERO_BYTE_FILE=Y



SET FILE_COUNTER=0

SET FILE_SIZE=0

SET ZERO_FILE_SIZE_FOUND=N



for %%a in (%TGTDIR%\*%INTERFACE_CODE%*.*) do (

for %%b in ("%%a") do (

SET FILE_SIZE=%%~zb

SET /a FILE_COUNTER=!FILE_COUNTER!+1

)

IF !FILE_SIZE!==0 (

SET ZERO_FILE_SIZE_FOUND=Y

)

)

::

:: NO NEED TO CHECK, NO FILES IN FOLDER

::

IF %FILE_COUNTER%==0 (

GOTO END_OF_SCRIPT

)



IF %FAIL_ON_ZERO_BYTE_FILE%==Y (

IF %ZERO_FILE_SIZE_FOUND%==Y (

@ECHO FAILED DUE TO ZERO BYTE FILE SIZE

GOTO CAUSE_ERROR

)

)



IF %CHECK_NUM_OF_FILES%==Y (

IF %FILE_COUNTER% GTR %MAX_NUM_FILES_ALLOWED% (

@ECHO FAILED DUE TO NUM OF FILES EXCEEDING MAX

GOTO CAUSE_ERROR

)

)

:END_OF_SCRIPT

EXIT /B 0


:CAUSE_ERROR

EXIT /B 1

Wednesday, March 9, 2011

Extending the Date Range in Siebel Analytics

Problem: Date range in Siebel Analytics stopped at year 2010.  We wanted to increase the date range to year 2050.  Please note that the solution mentionned below must be used with caution.  It is advised to test the solution first on a test platform.  Note that the steps mentionned below might need to be modified so that it works in your specific case.  Apply on PROD only if the tests proves successful.

Resolution:

Please test the solution below on a test platform prior to applying on PROD to ensure it works in your case.

Siebel Analytics Version: 7.9.2


1. Open DAC

2. Go to Design -> Task -> Query on “SIL_DayDimension” ->Parameters

3. Set the $$END_DATE parameter of SIL_DayDimension task to the required value.

4. Save changes.

5. Source file FISCAL_MONTHS: need to be amended manually to include extended date range

6. Go to Design -> Source System Parameters -> $$ANALYSIS_END/ $$ANALYSIS_END_WID ( Modify Parameters $$ANALYSIS_END and $$ANALYSIS_END_WID to the required values

7. Set the refresh date to NULL for the following tables (Setup --> Physical Data Sources --> Datawarehouse -->Refresh Dates):

a. W_DAY_D --

b. W_WEEK_D

c. W_MONTH_D

d. W_QTR_D

e. W_YEAR_D

f. W_DUAL_G —

g. w_day_d_fscl_mnth_tmp --

h. w_day_d_fscl_per_tmp --

i. w_day_d_fscl_tmp --

8. Back up tables W_DUAL_G, W_DAY_D, W_MONTH_D, w_day_d_fscl_mnth_tmp, w_day_d_fscl_per_tmp, w_day_d_fscl_tmp

9. Truncate tables W_DUAL_G, W_DAY_D, w_day_d_fscl_mnth_tmp, w_day_d_fscl_per_tmp, w_day_d_fscl_tmp

10. Insert row with row_wid 19800101 from BACKED_UP W_DAY_D as same doesnot seem to be populated by the mapping.
11. Run an incremental load of your typical execution plan

12. Check if W_MONTH_D has been properly extended.  If not, truncate W_MONTH_D

13. Manually run SIL_MonthDimension

The above steps should normally do it.  It did it in our case. All the best.