Prefix in flat file parsing

Hi,

I am trying to create a schema for a flat file which looks like this

00PTS 0000000000000303200308345400000770
0100016821700245 24500019175003022500
020001682170011722110 General Office
030001682170010019722110 0000004134
020001682170021701354 Travel Meals
0100016821700245 24500019176003022500
020001682170011722110 General Office
030001682170010019722110 0000004134
020001682170021701354 Travel Meals

and the record structure I want is

Record_00
Record_01
Record_02

Record_00 should be able to read the values from line starting with 00
Record_01 should be able to read the values from line starting with 01
Record_02 should be able to read the values from line starting with 02

I am not able to figure out where to specify the prefix for the lines in the flat file schema. I am using wM 6.1
Please help.
Thanks in advance.
Veena.

Veena,

I believe there is no way to specify the prefix for the RecordDefinitions,since the flat file has 00,01,02…as record identifiers you can only specify RecordDefinition (00)then only flatfile parsing works perfectly.

I am not sure why this makes difference for you when the RecordDefinition show like 00 instead of Record_00 in the DT.

Another way might be once your parsing is done then you replicate the DT structure and just rename the 00 to Record_00 and so on… and directly map the individual documents.

HTH,
RMG.

Hi RMG,

I did not notice before I posted the message that the indentation for the records are missing. Record_00 is the root, Record_01 is under Record_01 and Record_02 will be under Record_01

But the schema is not letting me to extract the data in this way.

Thanks,
Veena.

Veena,

Then your fixed lenght schema should be created this way.

Create root RecordDefinition(Record_00)under this build the fielddefinitions and in the same hierarchy level create RecordDefinition (Record_01)under this build fielddefinititions and in the same hierrarchy create RecordDefinition (Record_02) and build field definitions etc…

Record00
FieldDefinitions…
—Record01(set this to unlimited for multiple iterations)
FieldDefinitons…
-----Record02
FieldDefinitions
and if Record01 is multiple then set in the properties panel as "unlimited"so that this record will be repeated.

HTH,
RMG

RMG,

I did build the schema for with the structure I mentioned. But then I am not able to specify about the prefix and hence the schema is not working! We are doing an upgrade and in the old version, FileIO adapter was being used and there we could specify the prefix 00 or 01 or 02. Here I am not able to specify the prefix and hence my schema is not working!

Thanks,
Veena.

still wondering which prefix you are talking about?Where it should appear…is you flat file coming with 00,01 etc…and you want the RecordDefinition as (Record_00,Record_01 etc…)if so there is no way to specify prefix in the Schema,ultimately your parsing fails.

Regards,

RMG,

As I showed in the first post, the flat file I am receiving has lines starting with 00 or 01 or 02 or 03. I should parse the line starting with 00 into Record_00 and line starting with 01 int Record_01 and lines starting with 02 into Record_02. How can I do that with the flat file schema?

Thanks,
Veena.

I believe this is not possible to handle in the Schema itself since unless your flatfile has the lines starting with Record_00 etc…then the FF will parse.

May be someone handled this type of problem,let c.

Actually what you are asking is simple as stated above here is how I do it.

When I define my dictionary I define it with 2 or more records in the record definition. Each has its own set of fields defined (see example 1)

I define my schema with the record structure I require. In my case 901 records are child records to 900 records. (See example 2).

Then set the record Identifier starting position relative to 0 (See example 3)

Attached please find examples:

Attachment to Big send me your email address and I will send you examples
.

Hi Page,

That is how I have tried to handle the Flat file schema. I have also set the record identifier starting psosition to 0. But when I test the schema. I get only the Record_00 in the output!

My email address is vsathya_99@yahoo.com.

Would appreciate if you can send me those examples.

Thanks,
Veena.

The child records are within the parent records so in your case the 00 record would contain the 01, 02, … records. To process correctly you would have to loop over the 00 records to get to the 01’s. If you trace to after the transform and you do not see this type of record structure in the results tab then your schema is most likely at fault. I am emailing you my examples but it sounds like you are pass this point.

If this does not help and you are still having a problem then maybe we can do a Live Meeting so I can see what you see.

I had to just change the Record name from Record_00 to 00 and so forth. Now it is working!
Thanks for all your help.
Veena.

Veena,

That is what i suggested in the above posts if flatfile is starting with 00 then your recorddefinition(RecordName) should be defined as 00 then schema will parse as expected.

Anyways you finally solved it.

goodluck,

Hi Page/Sathya,

I’m a webMethods developer. I am having problem in creating a schema for the following flat file.

The inbound flat file will be like similar to this

A123344444444444
B8905690846890845
Caaaaaaaaaaaaaaaa
Bsdfsdgdfgdfhgfhgfhgfhgf
Bjsflgnldfnghndfjklnhklgfhkl
Clsnkglnslkgndfnglkndfklgnkldfng
Ddflgnldfngklndfklngkl

Constraints:
1.Each record is identified by the First character.
2.The B and C records can occur any number of times and in any order.
3.A is header and D is trailer occur only once.

We tried creating each record with name as A/B/C/D and defined the schema with record parser as ‘\n’

After parsing we are getting the records in thefollowing order.

A
B
C
–B –> coming as child to C
–B –> coming as child to C
–C –> coming as child to C
D

Our requirement is
A
B
C
B
B
C
D

In the WMUSERS.com we have seen simliar solution given by you. We are not getting the clear picture of the solution mentioned there.

Your help will be greatly appreciated. please send us if there are any examples to achieve this ASAP

Thanks,
Arjun.