Wednesday, August 24, 2011

DS - Useful QA's - Part II

10. Subject: SUGSEGV error
Ans1: When ever you have upgraded from v7 to v7.5 if a job Contains Transformer you need to do force compile (Go to Designer--->File Menu select the Force Compile the job and try to run the job. It should be ok. If Still you have a problem set this Environmental variable to True ($APT_DISABLE_COMBINATION=TRUE).

Ans2: Up to my findings your target table should be empty and there shouldn’t be any single record in the table then you will not get this error

*************************************

11. Convert a Julian date format to normal date format.
Example: My input is 2010078 now I want to convert this into 03/19/2010 format.

In datastage there is a standard function for this “DateFromJulianDay” but some how not able to use this. I need this for Server Jobs

Ans > Use iconv(coln,d2/) function in the derivation and you will get the result

Ans>>> you can do this conversion in a transformer stage. In the derivation of the concerned date field, use the iconv/oconv functions which might help you on this. I have experience only in PX/EE so not sure how you can achieve this in server job but you can definitely give it. I think it should work.

*****************************

11. Subject: main_program: ORCHESTRATE step execution terminating due to SIGINT

Getting following error message when I run parallel job. “main_program: ORCHESTRATE step execution terminating due to SIGINT”. This job loads data from dataset into sql server table?

Ans: Does your job generating more than 50 warnings?

If you want to know the exact reason, implant the below env variable:

1) Set the environment variable APT_DISABLE_COMBINATION to “true” and

Re-run to locate which stage is causing your abort...

******************************

12. How to get a user defined sql query file using Dynamic RDBMS stage in Datastage 8.1 version or can we use any other stage.

Ans: You can write your SQL query in SQL tab
output--> General Tab--> select User defined query--> SQL tab -- here you can write your query and make sure to add table definition (Columns tab--> Load) for your query once you finish writing your query


2Ans: Enter the pathname for this file instead of the text for the query. With this choice, you can edit the SQL statements.

Guess is to call the SQL Script including path name under Output tab->SQL->User-defined..

Under Outputab-->General->Provide table name and make sure that you have selected User-defined SQL Query file...

3Ans: Find the below navigation:

RDMBS-->Under Output Tab --> General Tab --> Click on QUERY TYPE drop down list were you can found the below options:

1.Generated SQL query.
2.User-defined SQL Query
3.User-defined SQL Query File

******************************

13. Created sequencers that run jobs. Want to create exception handler. Is there any general framework to create exception in DS? Are there any generic step by step ways?

Ans: You can always include the Exception Handler Activity followed by Notification stage or a command Activity to do the job.
Each job can be accompanied by a Terminator on the case of Failure, so that It reaches the control Exception handler at once.

2Ans: There is an exception handler stage available in the pallete when you create a sequence job. Its function is to handle any exception that are not explicitly handled in your job design.

******************************

14. When running a job, I get the following errors,

PS_JOB,0: [IIS-CONN-DB2-000004] DB2 function SQLFetch failed: SQLSTATE = 21000: Native Error Code = -811: Msg = [IBM][CLI Driver][DB2/6000] SQL0811N The result of a scalar fullselect, SELECT INTO statement, or VALUES INTO statement is more than one row. SQLSTATE=21000 (CC_DB2DBStatement::dbsFetch, file CC_DB2DBStatement.cpp, line 1448)

But when I view data in DB2 connector stage, it is ok, and then I copy that SQL to run in DB2’s command line, it is ok too.

Ans: According to the error message, your query returns more than one row.
Of course, this cannot be handled safely. If you don’t care about which
row to use, then you could apply the FETCH FIRST 1 ROW ONLY clause. If the
row matters, find the correct one.

********************************

15. In my datastage parallel job I want to get the number of rows in a dataset. I do not want care about columns (say I do not know the columns present in the dataset) present in the dataset and I do not want to pass through the records in the dataset to any stages and get the count from the link. Just if I given with the dataset I have to get the count of records present in it. Will that be possible. If so please help me how to find it.

Ans: use the linkinfo option to get the same.

dsjob -linkinfo <project> <job > <stage> <link>

Job - Job in which the dataset is been loaded.
Stage - Dataset Stage name
Link- Link Name.

2Ans: You can pass the rows to aggregator stage and use one unique field as a key, this will give you the row count.

3Ans: From the Designer use the DataSet Management tool, from the command
line use orchadmin (could also call this from the command stage or
sequential file stage.

4Ans: dsrecords is command-line utility which lists number of records in a dataset..

1.create a sample job wit out any stages & add job parameter it should be your dataset name.

2. write a script which will have the dsrecords command-line utility & call this script the ExecSH Command in before sub-routinue..

*******************************


Source: http://it.toolbox.com


Shyam S Reddy

No comments:

Post a Comment