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

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

Tuesday, August 23, 2011

Health Benefits of Drinking Water

“I'm dying of thirst!"

Well, you just might. It sounds so simple. H20 - two parts hydrogen and one part oxygen. This substance also known as water, is the most essential element, next to air, to our survival. Water might be everywhere, but one must never take it for granted.
Water makes up more than two thirds of human body weight, and without water, we would die in a few days. The human brain is made up of 95% water, blood is 82% and lungs 90%. A mere 2% drop in our body's water supply can trigger signs of dehydration: fuzzy short-term memory, trouble with basic math, and difficulty focusing on smaller print, such as a computer screen. (Are you having trouble reading this? Drink up!) Mild dehydration is also one of the most common causes of daytime fatigue. An estimated seventy-five percent of Americans have mild, chronic dehydration. Pretty scary statistic for a developed country where water is readily available through the tap or bottle water.

Water makes up more than two thirds of human body weight, and without water, we would die in a few days.

Water is important to the mechanics of the human body. The body cannot work without it, just as a car cannot run without gas and oil. In fact, all the cell and organ functions that make up our entire anatomy and physiology depend on water for their functioning.
  • Water serves as a lubricant
  • Water forms the base for saliva
  • Water forms the fluids that surround the joints.
  • Water regulates the body temperature, as the cooling and heating is distributed through perspiration.
  • Water helps to alleviate constipation by moving food through the intestinal tract and thereby eliminating waste - the best detox agent.
  • Water helps to regulate metabolism
Drinking eight glasses of water daily can decrease the risk of colon cancer by 45%, bladder cancer by 50% and it can potentially even reduce the risk of breast cancer.

 In addition to the daily maintenance of   our bodies, water also plays a key role in the prevention of disease. Drinking eight glasses of water daily can decrease the risk of colon cancer by 45%, bladder cancer by 50% and it can potentially even reduce the risk of breast cancer. And those are just a few examples! As you follow other links on our website, you can read more in depth about how water can aid in the prevention and cure of many types of diseases, ailments and disorders that affect the many systems of our bodies.
Since water is such an important component to our physiology, it would make sense that the quality of the water should be just as important as the quantity. Drinking water should always be clean and free of contaminants to ensure proper health and wellness.



When you were a kid in school, you learned that each molecule of water is made up of two hydrogen atoms and one oxygen atom. You may also have learned that it was great fun to fill up your squirt guns with water, at least until the principal caught you. What you may not have learned, however, was that you need water to be a healthy human being.
Why You Need to Drink Water
Your body is estimated to be about 60 to 70 percent water. Blood is mostly water, and your muscles, lungs, and brain all contain a lot of water. Your body needs water to regulate body temperature and to provide the means for nutrients to travel to all your organs. Water also transports oxygen to your cells, removes waste, and protects your joints and organs.
Signs of Dehydration
You lose water through urination, respiration, and by sweating, and if you are very active, you lose more water than if you are sedentary. Diuretics, such as caffeine pills and alcohol, result in the need to drink more water because they induce fluid loss.
Symptoms of mild dehydration include chronic pains in joints and muscles, lower back pain, headaches and constipation. A strong odor to your urine, along with a yellow or amber color, indicates that you may not be getting enough water. Note that riboflavin, a B vitamin, will make your urine bright yellow. Certain medications can change the color of urine as well. Thirst is an obvious sign of dehydration, and in fact, you need water before you feel thirsty.