Reading fixed string and aborting

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Nagasudheerkumar
Premium Member
Premium Member
Posts: 55
Joined: Tue Apr 24, 2007 1:26 am

Reading fixed string and aborting

Post by Nagasudheerkumar »

I have one ADDR_TYP_CD column with length of 10 i.e char(10) if iam getting more than 10 characters then the job should abort and if iam getting less than or equal to 10 characters I should read those data.
I know Varchar(10) can achieve only 2nd requirement but i have to do both.

Can anybody help me how to achieve this in sequentail file stage. This is a huge requirement for us now.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The goods news is that the problem can be solved, but you will need to supply more information.

Is the file that you are reading declared with fixed width or variable width? Are there column separator characters?

If there are column separator characters, then declare your field as VarChar(64) (just an example, any value will do in server jobs). Then in a transform stage simply query on "Len(In.Column) <> 10" to see if the column contains a valid number of characters or not.
Suruchi
Participant
Posts: 16
Joined: Tue Dec 13, 2011 3:21 am

Post by Suruchi »

Why do you want to abort the job via sequential stage?You can do the same using a transformer stage next to sequential stage.
Last edited by Suruchi on Tue Oct 09, 2012 8:00 am, edited 1 time in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you get a size 15 foot into a size 10 shoe? Then why do you think a requirement to store 15 characters in a Char(10) fields is legitimate?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply