Hi,
One of our jobs is receiving an input file from the mainframe(fixed with) and always has a header and trailer. In the constraint I have coded:
@INROWNUM > 1 and inSeqPlanfund_hldngs.PlanNumber <> "990000" to bypass reading them....
When I run I get the following error:
LoadBPASFile..seqPlanfund_hldngs.inSeqPlanfund_hldngs: nls_read_fixedwidth() - row 1, column fundid, column unexpectedly ended by EOR
A sample of the file is below. I'm not sure what I'm doing wrong.
AANQFinRpt20080731
06757539664222 879664100 TLAB Tellabs Restricted Stock Fund Tellabs Stk 0000000858413.692008-07-31000000137000000041
06757539664354 P007914XV$02178 Guaranteed Income Fund Guar Income Fnd0000001675281.512008-07-31000000137000000044
06757539664489 779562107 PRNHXT Rowe Price New Horizons T Rwe Pr Nw Hor0000003125262.732008-07-31000000137000000103
06757539664491 316071109 FCNTXFidelity Contrafund Fidelity Contra0000004513817.692008-07-31000000137000000109
06757539664493 922018304 Vanguard Windsor II Fd Admiral Vgrd Wdsr II Fd0000003093910.642008-07-31000000137000000090
06757539664496 693390726 PTRAXPimco Total Return Admin Fund A Pimco Tl Rtn A 0000001871737.542008-07-31000000137000000084
06757539664497 298706839 RERFXAmerican Funds Euro Pacific Gr R5 Am Fds EroPacR50000003466083.312008-07-31000000137000000108
06757539664686 922040100 VINIXVanguard Institutional Index Vangrd Instit 0000001213584.402008-07-31000000137000000079
9900000000010
Trying to skip reading of header and trailer
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 306
- Joined: Wed Jun 21, 2006 11:41 am
This doesn't look fixed-width, even after taking the header and trailer out of the picture. Each record needs to be the exact same number of bytes to be successfully read as a fixed-width file. And that includes the header and trailer records.
If you are sure about the fixed-width-ness of it, try reading it as one long string and then parsing / substringing out the individual fields you need to check or process.
If you are sure about the fixed-width-ness of it, try reading it as one long string and then parsing / substringing out the individual fields you need to check or process.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I think we're seeing wraparound here Craig. Apart from the first record they do appear to be the same size allowing for the wraparound.
However, that said, for fixed-width to work, then EVERY line must have the same size and structure. Your alternative is to read the file as a single VarChar, and parse it in a Transformer stage.
This may also allow you to identify the header and trailer records based either on their structure (length) or on their data.
However, that said, for fixed-width to work, then EVERY line must have the same size and structure. Your alternative is to read the file as a single VarChar, and parse it in a Transformer stage.
This may also allow you to identify the header and trailer records based either on their structure (length) or on their data.
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.
-
- Premium Member
- Posts: 306
- Joined: Wed Jun 21, 2006 11:41 am
They are wrapping(and really are fixed width)....I actually tried doing what you suggested Ray, by defining the whole record as VarChar and was erroring out....just realized I needed to uncheck the fixed-width for it to work. I will give it a shot and report back with the results.
Thanks for all the suggestions!! John
Thanks for all the suggestions!! John
-
- Premium Member
- Posts: 306
- Joined: Wed Jun 21, 2006 11:41 am