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.
Reading fixed string and aborting
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 55
- Joined: Tue Apr 24, 2007 1:26 am
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.
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.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: