Sunday, February 7, 2016

DATASTAGE ERROR CODES

API error codes in numerical order
CODEERROR TOKENDESCRIPTION
0DSJE_NOERRORNo InfoSphere DataStage API error has occurred.
-1DSJE_BADHANDLEInvalid JobHandle.
-2DSJE_BADSTATEJob is not in the right state (compiled, not running).
-3DSJE_BADPARAMParamName is not a parameter name in the job.
-4DSJE_BADVALUEInvalid MaxNumber value.
-5DSJE_BADTYPEInformation or event type was unrecognized.
-6DSJE_WRONGJOBJob for this JobHandle was not started from a call to DSRunJob by the current process.
-7DSJE_BADSTAGEStageName does not refer to a known stage in the job.
-8DSJE_NOTINSTAGEInternal engine error.
-9DSJE_BADLINKLinkName does not refer to a known link for the stage in question.
-10DSJE_JOBLOCKEDThe job is locked by another process.
-11DSJE_JOBDELETEDThe job has been deleted.
-12DSJE_BADNAMEInvalid project name.
-13DSJE_BADTIMEInvalid StartTime or EndTime value.
-14DSJE_TIMEOUTThe job appears not to have started after waiting for a reasonable length of time. (About 30 minutes.)
-15DSJE_DECRYPTERRFailed to decrypt encrypted values.
-16DSJE_NOACCESSCannot get values, default values or design default values for any job except the current job.
-99DSJE_REPERRORGeneral engine error.
-100DSJE_NOTADMINUSERUser is not an administrator.
-101DSJE_ISADMINFAILEDFailed to determine whether user is an administrator.
-102DSJE_READPROJPROPERTYFailed to read property.
-103DSJE_WRITEPROJPROPERTYProperty not supported.
-104DSJE_BADPROPERTYUnknown property name.
-105DSJE_PROPNOTSUPPORTEDUnsupported property.
-106DSJE_BADPROPVALUEInvalid value for this property.
-107DSJE_OSHVISIBLEFLAGFailed to get value for OSHVisible.
-108DSJE_BADENVVARNAMEInvalid environment variable name.
-109DSJE_BADENVVARTYPEInvalid environment variable type.
-110DSJE_BADENVVARPROMPTNo prompt supplied.
-111DSJE_READENVVARDEFNSFailed to read environment variable definitions.
-112DSJE_READENVVARVALUESFailed to read environment variable values.
-113DSJE_WRITEENVVARDEFNSFailed to write environment variable definitions.
-114DSJE_WRITEENVVARVALUESFailed to write environment variable values.
-115DSJE_DUPENVVARNAMEEnvironment variable being added already exists.
-116DSJE_BADENVVAREnvironment variable does not exist.
-117DSJE_NOTUSERDEFINEDEnvironment variable is not user-defined and therefore cannot be deleted.
-118DSJE_BADBOOLEANVALUEInvalid value given for a boolean environment variable.
-119DSJE_BADNUMERICVALUEInvalid value given for an integer environment variable.
-120DSJE_BADLISTVALUEInvalid value given for a list environment variable.
-121DSJE_PXNOTINSTALLEDEnvironment variable is specific to parallel jobs which are not available.
-122DSJE_ISPARALLELLICENCEDFailed to determine if parallel jobs are available.
-123DSJE_ENCODEFAILEDFailed to encode an encrypted value.
-124DSJE_DELPROJFAILEDFailed to delete project definition.
-125DSJE_DELPROJFILESFAILEDFailed to delete project files.
-126DSJE_LISTSCHEDULEFAILEDFailed to get list of scheduled jobs for project.
-127DSJE_CLEARSCHEDULEFAILEDFailed to clear scheduled jobs for project.
-128DSJE_BADPROJNAMEInvalid project name supplied.
-129DSJE_GETDEFAULTPATHFAILEDFailed to determine default project directory.
-130DSJE_BADPROJLOCATIONInvalid path name supplied.
-131DSJE_INVALIDPROJECTLOCATIONInvalid path name supplied.
-132DSJE_OPENFAILEDFailed to open UV.ACCOUNT file.
-133DSJE_READUFAILEDFailed to lock project create lock record.
-134DSJE_ADDPROJECTBLOCKEDAnother user is adding a project.
-135DSJE_ADDPROJECTFAILEDFailed to add project.
-136DSJE_LICENSEPROJECTFAILEDFailed to license project.
-137DSJE_RELEASEFAILEDFailed to release project create lock record.
-138DSJE_DELETEPROJECTBLOCKEDProject locked by another user.
-139DSJE_NOTAPROJECTFailed to log to project.
-140DSJE_ACCOUNTPATHFAILEDFailed to get account path.
-141DSJE_LOGTOFAILEDFailed to log to UV account.
-201DSJE_UNKNOWN_JOBNAMEThe supplied job name cannot be found in the project.
-1001DSJE_NOMOREAll events matching the filter criteria have been returned.
-1002DSJE_BADPROJECTProjectName is not a known InfoSphere DataStage project.
-1003DSJE_NO_DATASTAGEInfoSphere DataStage is not installed on the system.
-1004DSJE_OPENFAILThe attempt to open the job failed – perhaps it has not been compiled.
-1005DSJE_NO_MEMORYFailed to allocate dynamic memory.
-1006DSJE_SERVER_ERRORAn unexpected or unknown error occurred in the engine.
-1007DSJE_NOT_AVAILABLEThe requested information was not found.
-1008DSJE_BAD_VERSIONThe engine does not support this version of the InfoSphere DataStage API.
-1009DSJE_INCOMPATIBLE_SERVERThe engine version is incompatible with this version of the InfoSphere DataStage API.
 
API Communication Layer Error Codes
ERROR NUMBERDESCRIPTION
39121The InfoSphere DataStage license has expired.
39134The InfoSphere DataStage user limit has been reached.
80011Incorrect system name or invalid user name or password provided.
80019Password has expired.

DATASTAGE COMMON ERRORS/WARNINGS AND SOLUTIONS

DATASTAGE COMMON ERRORS/WARNINGS AND SOLUTIONS

1.     While running ./NodeAgents.sh start command… getting the following error: “LoggingAgent.sh process stopped unexpectedly”
SOL:   needs to kill LoggingAgentSocketImpl
              Ps –ef |  grep  LoggingAgentSocketImpl   (OR)
              PS –ef |               grep Agent  (to check the process id of the above)
2.     Warning: A sequential operator cannot preserve the partitioning of input data set on input port 0
SOL:    Clear the preserve partition flag before Sequential file stages.
3.     Warning: A user defined sort operator does not satisfy the requirements.
SOL:   Check the order of sorting columns and make sure use the same order when use join stage after sort to joing two inputs.
4.     Conversion error calling conversion routine timestamp_from_string data may have been lost. xfmJournals,1: Conversion error calling conversion routine decimal_from_string data may have been lost
SOL:    check for the correct date format or decimal format and also null values in the date or decimal fields before passing to datastage StringToDate, DateToString,DecimalToString or StringToDecimal functions.
5.     To display all the jobs in command line
SOL:   
cd /opt/ibm/InformationServer/Server/DSEngine/bin
./dsjob -ljobs <project_name>
6.     “Error trying to query dsadm[]. There might be an issue in database server”
SOL:   Check XMETA connectivity.
db2 connect to xmeta (A connection to or activation of database “xmeta” cannot be made because of  BACKUP pending)
7.      “DSR_ADMIN: Unable to find the new project location”
SOL:   Template.ini file might be missing in /opt/ibm/InformationServer/Server.
           Copy the file from another severs.
8.      “Designer LOCKS UP while trying to open any stage”
SOL:   Double click on the stage that locks up datastage
           Press ALT+SPACE
           Windows menu will popup and select Restore
           It will show your properties window now
           Click on “X” to close this window.
           Now, double click again and try whether properties window appears.
9.      “Error Setting up internal communications (fifo RT_SCTEMP/job_name.fifo)
SOL:   Remove the locks and try to run (OR)
          Restart DSEngine and try to run (OR)
Go to /opt/ibm/InformationServer/server/Projects/proj_name/
            ls RT_SCT* then
            rm –f  RT_SCTEMP
            then try to restart it.
10.      While attempting to compile job,  “failed to invoke GenRunTime using Phantom process helper”
RC:     /tmp space might be full
           Job status is incorrect
           Format problems with projects uvodbc.config file
SOL:      a)        clean up /tmp directory
              b)        DS Director à JOB à clear status file
              c)         confirm uvodbc.config has the following entry/format:
                       [ODBC SOURCES]
                       <local uv>
                       DBMSTYPE = UNIVERSE
                       Network  = TCP/IP
                       Service =  uvserver
                       Host = 127.0.0.1

Tuesday, December 15, 2015

Surrogate_Key_Stage

SURROGATE KEY IN DATASTAGE

Surrogate Key is a unique identification key. It is alternative to natural key .

And in natural key, it may have alphanumeric composite key but the surrogate is

always single numeric key.

Surrogate key is used to generate key columns, for which characteristics can be

specified. The surrogate key generates sequential incremental and unique integers for a

provided start point. It can have a single input and a single output link.



WHAT IS THE IMPORTANCE OF OF SURROGATE KEY
Surrogate Key is a Primary Key for a dimensional table. ( Surrogate key is alternate to Primary Key) The most importance of using Surrogate key is not affected by the changes going on with a database.

And in Surrogate Key Duplicates are allowed, where it cant be happened in the Primary Key .

By using Surrogate key we can continue the sequence for any jobs. If any job was aborted at the n records loaded.. By using surrogate key you can continue the sequence from n+1.



Surrogate Key Generator:

The Surrogate Key Generator stage is a processing stage that generates surrogate key columns and maintains the key source.
A surrogate key is a unique primary key that is not derived from the data that it represents, therefore changes to the data will not change the primary key. In a star schema database, surrogate keys are used to join a fact table to a dimension table.
surrogate key generator stage uses:
  • Create or delete the key source before other jobs run
  • Update a state file with a range of key values
  • Generate surrogate key columns and pass them to the next stage in the job
  • View the contents of the state file
Generated keys are 64 bit integers and the key source can be stat file or database sequence.
Creating the key source
Drag the surrogate key stage from palette to parallel job canvas with no input and output links.
Double click on the surrogate key stage and click on properties tab.
Properties:
Key Source Action = create
Source Type : FlatFile or Database sequence(in this case we are using FlatFile)
When you run the job it will create an empty file.
If you want to the check the content change the View Stat File = YES and check the job log for details.
skey_genstage,0: State file /tmp/skeycutomerdim.stat is empty.
if you try to create the same file again job will abort with the following error.
skey_genstage,0: Unable to create state file /tmp/skeycutomerdim.stat: File exists.
Deleting the key source:
Updating the stat File:
To update the stat file add surrogate key stage to the job with single input link from other stage.
We use this process to update the stat file if it is corrupted or deleted.
1)open the surrogate key stage editor and go to the properties tab.
If the stat file exists we can update otherwise we can create and update it.
We are using SkeyValue parameter to update the stat file using transformer stage.
Generating Surrogate Keys:
Now we have created stat file and will generate keys using the stat key file.
Click on the surrogate keys stage and go to properties add add type a name for the surrogate key column in the Generated Output Column Name property

Go to ouput and define the mapping like below.
Rowgen we are using 10 rows and hence when we run the job we see 10 skey values in the output.
I have updated the stat file with 100 and below is the output.
If you want to generate the key value from begining you can use following property in the surrogate key stage.
  1. If the key source is a flat file, specify how keys are generated:
    • To generate keys in sequence from the highest value that was last used, set the Generate Key from Last Highest Value property to Yes. Any gaps in the key range are ignored.
    • To specify a value to initialize the key source, add the File Initial Value property to the Options group, and specify the start value for key generation.
    • To control the block size for key ranges, add the File Block Size property to the Options group, set this property toUser specified, and specify a value for the block size.
  2. If there is no input link, add the Number of Records property to the Options group, and specify how many records to generate.

tMap vs tJoin -Talend

  tMap is frequently used component for joins and lookup purpose, it is also use for verity of operations and transformations, whereas tJoin...