DataStage scenario based question:
There is a column having both numbers and alphabet, the requirement is to separate all the numbers in one column and alphabet in other column.
First read the input data in sequential file stage:
Next pass the input data to transformer stage. We can separate alphabets and numeric using 2 stage variables in transformer stage.
Create stage variables like below:
svAlpha: Convert("0123456789","",lnk_alphanumerics.MixData) svNumerics: Convert(svAlpha,"",lnk_alphanumerics.MixData)
Read also: What is a Schema File in DataStage?
Assign these stage variables to output columns like below.
svAlpha = Alpha svNumerics = Number
Final job design would be:
Compile and run the job.
We will get output like below.