Sequential File
Moderators: chulett, rschirm, roy
Sequential File
Hi Guys,
I am sourcing data from Sybase and dumping to Sequential File, But end of the data in one field is Poping-up in next Row.
Guys any solution.
7460 D05357 2 INH 20051017 20051021 20051024 WILLN MICHAEL PETERS,ERNIE WESTON CONCEPT AND FEASIBILITY HONG K 04-000
7461 D911241 10 INH 19921216 19921216 19930526 TRANSFER M. PARKER CASTLEAF PILOT
PLANT"
7462 D911251 10 INH 19920114 19920114 19930526 TRANSFER M. PARKER CASTLEAF PILOT
PLANT"
7463 D911287 10 INH 19920114 19920114 19930526 TRANSFER M. PARKER CASTLEAF PILOT PLANT
Thanks
Martin
I am sourcing data from Sybase and dumping to Sequential File, But end of the data in one field is Poping-up in next Row.
Guys any solution.
7460 D05357 2 INH 20051017 20051021 20051024 WILLN MICHAEL PETERS,ERNIE WESTON CONCEPT AND FEASIBILITY HONG K 04-000
7461 D911241 10 INH 19921216 19921216 19930526 TRANSFER M. PARKER CASTLEAF PILOT
PLANT"
7462 D911251 10 INH 19920114 19920114 19930526 TRANSFER M. PARKER CASTLEAF PILOT
PLANT"
7463 D911287 10 INH 19920114 19920114 19930526 TRANSFER M. PARKER CASTLEAF PILOT PLANT
Thanks
Martin
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Is the quote character in the Sybase data? Change the Format tab of your Sequential File stage so that " is not the quote character - maybe set the quote character to 000 (no quotes).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
U can build a FUNCTION like this and call it in ur transformer:
[/code]
Code: Select all
i=1
Len1=Len(Arg1)+1
loop while(i<Len1)
str1 = Iconv(Arg1[i,1],"MY")
if(str1 NE '0D') Then
Arg1[i,1] = Oconv(str1,"MY")
End Else
Arg1[i,1] = Oconv("20","MY")
i=i+1
Arg1[i,1] = Oconv("20", "MY")
End
i=i+1
repeat
Ans = Arg1[code]
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Why are you reinventing the wheel? And why are you trying to use C constructs unnecessarily in DataStage BASIC?
does what your routine does, but much more efficiently.
If Char(13) were the initial value of a stage variable that remained unchanged, then the even more efficient expression could be used.
It might be necessary to specify in the Format tab of the Sequential File stage that particular columns might contain line terminators.
Code: Select all
Convert(Char(13), " ", InLink.TheString)
If Char(13) were the initial value of a stage variable that remained unchanged, then the even more efficient expression
Code: Select all
Convert(svChar13, " ", InLink.TheString)
It might be necessary to specify in the Format tab of the Sequential File stage that particular columns might contain line terminators.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
For giggles, put an OCONV(inlink.col, "MCP") derivation on your problematic column to convert all non-printable characters to a ".". That will make sure your issue is not any high-character. Does that change the problem row?
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Yeah, well, you've now got a "." in your data. So your issue is high characters, maybe not necessarily a CR/LF, maybe a TAB. You're going to need to write a routine to strip all non-printables and change them to something you desire.
If you just want them removed, the CONVERT statement can serve you well. There's this post going on right now:
viewtopic.php?t=96128
that will serve you well. I posted a functions logic to pick out the high characters of your choice and replace with a "*". In your case, your replacement string should just be "" if you want the characters removed.
If you just want them removed, the CONVERT statement can serve you well. There's this post going on right now:
viewtopic.php?t=96128
that will serve you well. I posted a functions logic to pick out the high characters of your choice and replace with a "*". In your case, your replacement string should just be "" if you want the characters removed.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle