Hi,
I have a sequential file having footer record differrent format.
in sequential stage getting warning on the last record.
any workaround instead of multiple record type handling trick.
TIA
SAM
Sequential File...footer record have different format
Moderators: chulett, rschirm, roy
The answer depends upon the type of warning you are getting with the footer row - please tell us what the warning is. If it is a sequential-file read error there might not be a way to read that last errant row without generating a message, so you might need to execute a before-job command that strips out the last line, or does a "wc -l" to get the number of lines and use that value in your job.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Just saw the same thing, it is a PX job (but posted in the Server forum) so the solution is quite different. As Sainath stated, with a Px sequential file read you can specify "read first rows" to limit the number of rows read using the output from a "wc -l" UNIX command and using 1 node. The best solution if the input file isn't huge is to make a copy without the offending last line.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Not sure if this is the 'best' way to do it, but it worked well for us. We had a file that had both header and footer records. On import, we specified the main record layout and then made sure there was a reject link. The reject from an import leaves the data as a raw field so on the reject link we used the field import stage. The field import used the layout for the header/footer (they happened to be the same layout). We also had a reject link coming out of the field import (for real rejected records) and those got dumped into a dataset.
If you just don't need the header/footer, you could just leave them as rejected records (and skip the field import).
bcarlson
If you just don't need the header/footer, you could just leave them as rejected records (and skip the field import).
bcarlson