Author |
Message
|
Tonedef |
Posted: Thu Feb 07, 2008 8:20 am Post subject: MRM - Variable Length Records problem |
|
|
Apprentice
Joined: 05 Feb 2007 Posts: 44
|
Can someone confirm if i've missed something please.
I'm trying to model a flat file, and i've got 99% of what I want.
the flat file is fixed length fields, variable length records.
the one problem I cant seem to resolve is when the last field is not padded to the full length of the field the next record is not parsed correctly.
e.g. instead of the records looking like
TAGDATA DATA DATA <CR><LF>
it looks like
TAGDATA DATA DATA<CR><LF>
any ideas ?
tony |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 07, 2008 9:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Variable-Length-Elements-Delimited, maybe.
That <CR><LF> is a Group Terminator, maybe. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Feb 07, 2008 1:10 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
As Jeff says, use Variable Length Elements Delimited.
Set a length on all except the final record in the structure.
You may be required to specify a delimiter, but it doesn't really matter what you enter, because the final record will use the 'terminating markup' ( Delimiter or Group Terminator ) defined for the parent ( the CR/LF ). |
|
Back to top |
|
 |
Tonedef |
Posted: Thu Feb 07, 2008 2:05 pm Post subject: |
|
|
Apprentice
Joined: 05 Feb 2007 Posts: 44
|
Sorry I used a pretty simple example,
the records are 50-60 fields in depth and only the first few of each record are mand. |
|
Back to top |
|
 |
christian witschel |
Posted: Fri Feb 08, 2008 1:54 am Post subject: |
|
|
Apprentice
Joined: 07 Dec 2005 Posts: 27
|
Simple workaround solution:
create a compute node and walk through your file in advance filling the last field to the max so it matches your message set.
(if the dog does not come the bone, the bone has to come to the dob) |
|
Back to top |
|
 |
kimbert |
Posted: Fri Feb 08, 2008 2:20 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Better solution : change the Data Element Separation to 'Use Data Pattern' and specify the lengths of the fields by adding patterns like '.{5}' for a 5-character field. 'Use Data Pattern' will tolerate missing fields. 'Variable Length Elements Delimited' will not. |
|
Back to top |
|
 |
|