Wednesday, August 24, 2011

DS - Useful QA's - Part I

1. There is 10 years records and I want only Last months record from that then what to do?

Ans1: Select the SYSDATE and trunc for month and subrtract minus 1. And check for less than 2. Hope its a database which has data field in it.

Ans2: Using field date functions with IF, THEN, ELSE in transformer after sequential file (Or)
Using External filter Stage with grep command
(Or)
Using filter command in sequential file stage
****************************

2. We are getting it on Insert into table sh: dbx: not found Operator terminated abnormally: received signal SIGSEGV

Ans: SIGSEGV is the UNIX signal meaning “Segmentation Violation”, an attempt to access a memory address not owned by the process Run out of memory.

Lets Try The Below Solution’s may help out:

1) Change the jobs to use Join Stage or Merge Stage instead of lookup. Try to Handle the file Sizes

2) Some Time Job will run successfully but some time not. In this case handling ‘NULL’ or Data Type Conversions.

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

3. When running datastage job IN UNIX, getting the below Error, I am running the dsenv also before running the job.

$dsjob -run PROJECT_NAME DSJOJ_NAME
Error running job  Status code = -99 DSJE_REPERROR ??

1Ans: Its an Repository error.
Check the project and Job name for any type.
$DSHOME/bin/dsjob -run -jobstatus PROJECT_NAME DSJOJ_NAME
Pass parameter is any mandatory

**********************************************
4. I have a requirement of getting random “n” records from a text file and that “n” would be present in another table. For example if my original input file is input.txt then the random records to be fetched would be present in number.txt.

1Ans: You could count your input file, divide the count by “n” to give you x, then take every “x” record by input rownum in a transform stage.

2Ans: Or assign a Random partition and choose only one partition till you reach ‘n’ records.

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

5: How to lock \unlock the jobs as Admin?

1Ans: Open DataStage Director
click on Job
click on CleanupResources
there you can see a window.
select “Show all”
 
You can see your user id and then logout from there

2Ans: If the CleanUp resource option is diabled, you should ask you adminstrator to enable the Admistration over the Director to get that done.
And the other option should be executed in “Command” option from the admisntrator.

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

6: How can we use shell script in the middle of job?? I can get record count from datastage job and then How can I assign parameter to seperate records.
To make my question more clear, If I have 3 records, then count=3. So, the file should create 3 seperate text files and each file contain only one record.

1Ans: First you would have calculated the total number of records. You create a records based on some or you key column with a comma seperated in a file.

get: key1,key2,key3

write it into a file and read it in Start loop activity or pass it as parameter to start loop activity.
Call the actual job, and pass these keys as parameter.
In transformer if the key is key1 by using job parmeters and pass that particular record to output.

Pass the parameter to filename. like File#parameter#.txt
So you will get each record in each file based on the keys.

Source: Deepak – ITToolbox.com

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

7: DataStage never shows the log until the script invoked by it is finished. Sometimes, the script is hanging there and seems to be doing nothing. so I’d like to know if there is anywhere DataStage puts the execution detail(progress or echo ) into?

find some files in dstmp for this, but I doubt that.

1Ans: Using Execute command.
yep, Echo would get printed in the log of DataStage, but I wanted to see this log before the Execute command stage finishes, coz sometimes the job is hanging there without this Execute command stage complete, I’d like to find out what the problem is.

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

8: table with 1-Column and N-Rows now I need to collect all the rows and insert together in other table separated by comas.

1Ans: Concatinate in Transformer with previous row and pass only the last row for that set.

2Ans: Use stage variable or write sql query( Using analytical function, if you are using oracle as database) in database stage that you are using.


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

Subject: Unable to execute dsjob command
Using Datastage7.5 Server job. Executed a job from command line, following are the steps

Step1 cd /Ascential/Ascential/DataStage/DSEngine
Step 2 . ./dsenv
Step 3 cd bin
Step 4 dsjob -run taxdev Enp_Load
taxdev is the project name
Enp_Load is the job
I am getting an error ---- ksh: dsjob: cannot execute

What is the issue?

Ans: First check if you have dsjob exe in that given path.
Do check if you are in the current DS Home. You can check it by cat /.dshome

I executed cat /.dshome & I got /Ascential/Ascential/DataStage/DSEngine .
dsjob is present in /Ascential/Ascential/DataStage/DSEngine/bin
dsjob shows zero bytes ,what should it consists of? Its a command or a executable file? Could you please help me in knowing this.

Yes? it is a executable. You would just find binary information in the file.
It shouldn’t be zero byte.
See how it got corrupted. And try to restore it.
Do see if that’s the only file got corrupted too.

Source : ITToolbox.com

No comments:

Post a Comment