PDA

View Full Version : Flat File Content


sandeepchauhan
02-13-2003, 04:15
Hi All,
I have my own defined schema for parsing the flatfile and I am able to receive the data in TN and this document is appearing in the TN with corrosponding matching document type and processing rule but there is no data and byte-length is 0 bytes.
I am using wM 6.0 and my flat file is comma seperated.
I do appreciate your replies in advance

dgreen
02-13-2003, 06:36
Hi, Sandeep.

Be sure that the HTTP POST has the proper variable name assignments. It sounds like the FORM is successfully posting via HTTP, but is not carrying the proper name-vale pairs.

As a debug step, set pub.flow:savePipeline as the first step of your Flow. After running your test, manually execute pub.flow:restrorePipeline using CTRL-R. From the Results tab, you will gain access to the pipeline variables passed to your Flow.

To recap: Review the HTML and confirm your pipeline cariables at Flow invocation.

Thanks.

iandrosov
02-13-2003, 10:35
Sandeep

This also can be a TN problem. I have encountered similar case when sending custom data of say Word document when I actually constructed bizdoc and set up document type and sender reciever was correct I also created Content parts array element with data in it in TN I see the document type recognized and processing rule started too but there is no data showing in Content? If I constructed document with plain text data or string or XML same document does persist the content and I can see it. It is stored in BizDOc ContentParts array/list. I have not yet figured out if its a bug in TN or I am missing something. I recall spending some time o this problem. In your case you have flat file and if you parse it using EDI adapter custom template than your data will be in form of XML record and not flat data in TN.

Sandeep Deshmukh
02-18-2003, 01:35
Thanx a bunch Igor and Dan..Let me try it out and let u know.

srivats
10-28-2003, 13:11
I am new to webmethods 4.6. I need ur help urgently....!

How to read a a flat file and store them in a record array. (Plz help me how to create a record array).

I would appreciate your help.
Thank you.

bouellet
10-28-2003, 13:22
Hi Srivats,

You need to create a flat file schema first.

You can then create a flow service that will use the following convertToValues service found wmPublic. I found the flat file documentation provided with Developer quite usefull in getting this setup.

Hope this helps.

bouellet
10-28-2003, 13:32
Sorry... I hit the wrong button...

convertToValues service found in wmPublic will allow you to take your flat file in.

The ISFlatFileSchemaGuide should help you with setting up a schema. I found this PDF document under the webMethods6\Broker\Developper\plugins\FlatFilePlugin\Doc folder on my IS server.

You may also want to look at the ISFlatfileSchemaGuide.pdf and the flat file samples provided in Developper.

RMG (Unregistered Guest)
10-28-2003, 13:36
Srivats,

Please go thru the ISSchema guide located in packages/WmFlatFileSamples/doc or pub/doc folder.It will be helpful for starters.


HTH.

wkriski
10-28-2003, 13:50
If you are using 4.6 as you mentioned, you won't have the flat file schema functionality as described above.

If this is the case, use the getFile service and then tokenize the string (is it a comma delimited or tab delimited file for example) - which is breaking it up separating it by carriage returns and then by tabs or commas. Or you can write some java code to read a line at a time and then tokenize it. Prior to v6.0 this is not a fun exper
ience!

And as I've said many times - please read the wonderful docs thoroughly.

RMG (Unregistered Guest)
10-28-2003, 14:04
Srivats,

Oops,If you using IS4.6,please follow the will Kriski steps/suggestions.

I was fast and responded with out observing your IS version mentioned in your post.

Thanks,

srivats
10-28-2003, 19:34
Hi All,

Thank you for your help. Thanks Will..i did what u said and I could get the data from the flat file into record. Actually, I i used getFile service, then tokenized and then converted those to StringTable and then used tableToRecordList...I took the help of wmSamples..Flatfile parsing...

Thank you all...

My big problem now is I have a flatfile like this:
20|101|xxx|yyy|s@msn.com |30|msc|computers |30|bsc|computers |40|xxx|xx
20|102|yyy|xxx|y@msn.com |40|TX|78041

i have records like this in which..20(indicates record type) is the main record and 30-80 are the subrecords. I need to read line and place these values into record(record list)....Can any one could help me please.

I can break these lines into:
20|102|yyy|xxx|y@msn.com
40|TX|78041

and loop ...but i am not getting the logic...so please help me..

I would appreciate your help..Thank you

Srivats

jsampath
10-29-2003, 09:36
Hi Srivats,

Other way around is to use the capabilities of wmEDI module to do the flat file parsing if you are using wm 4.6 Integration Server. You can define custom input formats and output formats and handle hierarchy flat file structures easily with EDI module.

Thanks,
Sam

srivats
10-30-2003, 13:53
Please respond !!!! Urgent help required !!!

I have a flat file with records of form
20|Name1|Name2|7235891
30|Laredo|Texas|78041
30|Portjefferson|Newyork|11777
20|Name3|Name4|7919667
30|City1|State1|Pincode1

and so on ..
where 20 represents the main record and 30 represents its sub records. Here first one(Name1) has 2 sub records(Laredo,Portjefferson). 2nd one(Name3) has one sub record(city1). And it goeson as such.

What i need to do is to read the flat file and store these records in a record list as main records and subrecords. Plz help me out, how to do this task.

I would appreciate your help..
Thank You,
Srivats.

chirag_sanghavi
10-31-2003, 04:10
Hi Srivats,

What is the version of Integration Server that you are using? As I understand, it is 4.6. You need to use WmEDI package. There is a service called as convertToValues. This service needs to be provided with the data and a template, which will be able to understand that data. If you look at documentation provided with WmEDI package, and WmEDISample Package it will help you to write a FlatFile Template (which looking at file structure that you have, seems to be easy to create based on similar samples that have been provided in WmEDISamples), and process data.

Regards,

mcarlson
01-31-2004, 11:02
Find the documentation and examples for the webMethods Flat File adapter that ships with 6.x. Read the docs and work through the examples. This should get you most of the way there. Then post any more specific questions you have here.

If you haven't worked with the webMethods Integration Server before, I suggest working through the tutorials to gain a basic familiarity with the product. That will serve you well before you tackle parsing an EDI document and attempting to do something useful with it.

Mark

g_lokanadh
02-02-2004, 12:50
Hi Professionals,
I created on flatfile schema for a flat file. I succeeded in the test case. Can anyone explain me how to validate a flatfile upon the schema. I mean how can i utilize the service convertToValues?
I need your urgent help.

regards

maldonado
02-02-2004, 13:17
Hi g.lokanadh,

Yes, you need to use the converToValues service from the flatFile package.
This service has a input parameter called validate. Setting this parameter as true, the flatfile passed as parameter (ffData) will be validated against the schema (another input parameter - ffSchema). Itīs interesting to set the parameter returnErrors as asArray. It will make easier to you to treat an error within a try/catch implementation (my point of view) if they occur.

HTH,
Maldonado

raymoser
02-02-2004, 13:23
You are asking for two things:

1. How to validate flat file using a FF schema.
2. How to utilize the service convertToValues.

Answer to #1:

Use the service: pub.schema:validate. Pass in the Document as the object. In the conformsTo input, put in the fully qualified name space name for the document. You can set maxErrors to -1 to get all the errors back. Probably want to set failIfInvalid to false so you can trap and handle yourself in your code.

Answer to #2:

The guide displays this info, but here's a quick explanation: I assume you are using pub.flatfile:convertToValues. If so, then pass in the string containing the flat file data into the input field ffData. In the ffSchema input field, put in the fully qualified name space name for the flat file schema. The rest are optional. It will convert your file to the ffValues record which should contain an xml version of your flat file. I say this in that you should be able to pick out various pieces of data according to your ffSchema/ffDictionary setup. Also, it will output an errors array which should help out a bit.

HTH

Ray

g_lokanadh
02-03-2004, 09:57
hi professionals,
Thanks for your nice help for validation of flatfile. can u give me the idea about how to access the Idata objects from the service convertTovalues. Now i am trying to take some operations on those field values.

regards

mcarlson
02-03-2004, 10:29
Something that really confused me about flat file schemas was the requirement to name the root node of your record definition the same thing as the record ID of the flat file record you are working with.

For those of us new to EDI, this isn't intuitive. In EDI scenarios (and other similar standards), records in a flat file are parsed differently based on the first few characters of the record (called a record ID). By naming the root node of your record definition by this record ID you tell the flat file schema how to parse each record in your flat file.

Some flat files only contain one type of record. These file often do not have a record ID. There are also times when you are using a flat file schema to process a single text string such as when you are reading or writing messages to MQ Series queues. In these cases you have to name the root note of your flat file schemas record definition with the string "recordWithNoID".

The screen shot below shows a flat file schema which was designed to parse a 121-character string with fields in fixed positions. The record type in this example does not require a recordID so the "recordWithNoID" string is used.

http://www.wmusers.com/wmusers/messages/117/30515.jpg

The next screen shot shows the call to the pub.flatFile:convertToString service which is used in this case to create a 121-character string from a document type that contains the data fields. In this example, I only needed to create a single string to be sent as a message to a Websphere MQ queue. By using a documentList as input and setting the Max Repeat attribute of my record definition to unlimited, I could have created a sting containing multiple records to be written to a file.

http://www.wmusers.com/wmusers/messages/117/30516.jpg

In general, I haven't found the docs for the flat file package or the "Flat File Development Guide" to be as useful as I would like. I also think the Developer UI for creating and maintaining flat file dictionaries and flat file schemas needs some work to make it more intuitive. That being said, if you work at it long enough, it eventually makes sense and does what you'd expect it to do.

Mark

folsen
02-03-2004, 12:39
To Mr. Carlson,

I've got a very silly question at this point: where are the tutorials? On Advantage I only found tutorials for version 4.6. Are they in the User's Guide?

Best regards,

Frank Olsen

RMG (Unregistered Guest)
02-03-2004, 13:03
They hold some valuable predefined examples/flows/documentation (usersguide pdf's).

HTH.

mcarlson
02-03-2004, 13:09
Go to the home page of the WmFlatFileSamples package. If you have IS installed on your local workstation that would be:

<font color="0000ff">http://localhost:5555/WmFlatFileSamples/</font>

HTH,

Mark

gdpani
03-16-2004, 09:37
I am trying to parse the mainframe punch file which is of fixed length of 400 characters. I have created the flatfile Dictionary and schema. I am using the schema to parse the flatfile which contains the multiple records each of length 400 characters. while parseing using the Test tab on the Flatfile Editor from the developer, I am able to get only the first record parsed successfully. All the remaining records are not parsed and I get the "recordWithNoID" for the number of records in the flatfile.

Could you please tell me how can I solve this problem.

Thanks

rmg
03-16-2004, 10:07
Dhandapani,

Make sure in the flatfile Dictionary/Schema if "recordWithNoID" record definition under properties max Repeat set to "unlimited" or 1.
Set this option to "unlimited" for parsing multiple records.

And also check the Flatfile Definitions settings like (Record Delimiter (newline or carriagereturn or tab)depends on your sample mainframe flatfile.


HTH.

gdpani
03-16-2004, 10:44
RMG,

I have not defined any record for the "recordWithNoID" in the dictionary/schema because all my records have a record identifier at position 0, the first 3 characters are record identifier in my flatfile.
I am using the mainframe punch or fixed length file for which I don't know what would be the record delimiter.

I tried using the newline and carriage return for the release character option in the definition tab, but still I am getting the recordWithNoID with no data in it. For me it seems its not recognizing the record idtnetifier in position 0 of the record.

All my records have "unlimited" option set for the Max Repeat property except the Header record which I am able to extract.

I am using the webMethods 6.0.1

Thanks

chrisl
03-18-2004, 20:18
You may have a record delimiter issue. You need to view a copy of the file on you wm server in some sort of a hex editor. On windows you can use debug or the UltraEdit text editor. If you're on UNIX find the equivalent.

HTH

gdpani
03-19-2004, 10:18
Chris,

Thank you, using Ultraedit I was able to figure out the problem.

a_rajasekhar
05-26-2004, 00:54
Hi,
Currently I am working on a flatfile schema. It contains 3 record types. It can contain one header record, one trailer record and multiple details records. I have a field in trailer record called total count, which should display the total number of records( i.e. 1 header+ no. of detail + 1 trailer). Is there any logic to count no. of details records at runtime in a flatfile? Plz. send reply.. Thank you...

From,
Raja sekhar.

kalyan
05-26-2004, 01:29
Raj Shekar,

When creating either a Record Definition or Record Refernce in FlatFile schema there is a property called Check Fields. Set this to True and check. A variable called segmentCount will be added to that Record which gives the count.

Regards,
Kalyan

a_rajasekhar
05-26-2004, 04:27
Hi Kalyan,
Thanx for the Help............

BE77 (Unregistered Guest)
05-26-2004, 15:28
Has anyone tackled the issue of reading in a flat file with a multiple character record delimiter? I need to delimit my records based up opon three alpha characters, and I do not believe that the wMFlatFile adapter will allow for this.

Regards

chrisl
05-27-2004, 07:50
If you're using 6.X you can specify the delimiters on the Flat File Definition tab when creating the schema.

BE77 (Unregistered Guest)
05-27-2004, 12:21
Chris, I have pretty extensive knowledge of the 6.X platform including the wMFlatFile package, delimited and fixed length parsing. However, I have a specific question regarding multiple character record delimiters in a delimited file.

example data:

M00103|01|R|1991|END K01023|52| |2000|END M00099|03| |1|END END_OF_DATA

There are three records in the string. Fields are pipe delimited. Records are 'END ' delimited. The end of file is recognized by the string END_OF_DATA.

Unfortunately, as far as I can tell, in the flat file schema it will not allow a user to enter more than one character for a record delimiter.

Thank you

rmg
05-27-2004, 12:51
I believe there is no way of handling multiple Record Identifiers using the FlatFile Schema editor.

Regards,

chrisl
05-27-2004, 13:16
BE77,

You can enter more than one character as the record delimiter but it only seems to pick up the first character. Maybe that's a bug.
If it allows the entry then in theory it should process it. I would take it to Tech support.

Let us know the result.

raymoser
05-27-2004, 13:41
BE77,

I would parse the file the old fashion way without using the FF adapter since it is not as flexible as needed.

You could look at it like this: If the END_OF_DATA string is present, then you know for processing sake that the file is whole (not partially written). If this is the case, then you should be able to pass the string into the string tokenizer and use the '|END ' as a delimiter (or something close to this.

It will yield a string array of your individually pipe-delimited records. Then, you can call a child flow that breaks the string record apart into an IData record containing the fields, passing in one record at a time, receiving the IData single record that can be appended to a Document List. There are more optimized methods of coding, but this will get you to a point where you can process records.

Does this make sense??


HTH

Ray

BE77 (Unregistered Guest)
05-27-2004, 15:37
Thank you all for your support and suggestions. I appreciate it. I will probably just continue on as I started after running into this issue and use the replace flow to add a file delimiter (carriage return)after each 'END ' and use the 'END ' as the record ID. This simplifies the process quite a bit and allows me to use the FF parser to convert the files and perform validations.

Thank you though. If anyone hears of a method to map multiple characters into a delimiter, or, as RMG mentioned, to call multiple document identifiers for multiple records within a file, please email me.

groove81@juno.com

REGARDS

sivawithwipro
05-09-2005, 08:21
Hi, I have a Flat File Schema like as follows.

Record delimeter: !
Field Delimeter: *

And the Flat file Structure is:

Header
- AuthorizationCode
- Deptno

I am passing the flat file(text file) while running the Flat file Schema.
The contetns of the Text file is:
Header*100*100!Header*200*100!

But i am getting errors like "[FFP.0011.0012] Unexpected element" in the error position: 2. and "isValid" is False.

If i try to give only one record as the input,that is Header*100*100!, it works fine. and "isValid" is True.

Can any body help me on this. Thanks

rmg
05-09-2005, 08:46
What is your RecordDefinition set to? and make sure the maxRepeat set to unlimited if there are multiple records in the flatfile.


HTH,
RMG

sivawithwipro
05-09-2005, 22:50
Yes, RMG. U R Correct. I haven't set the MaxRepeat as Unlimited. I have done that its fine. Thanks for your nice tips.

sivawithwipro
05-10-2005, 01:45
Hi, I have a Fixed length Flat file like

SampleRec*Siva*12345

The flat file schema is :

SampleRec
- Name
- Age

And i gave the Record length as 21. And field Delimiter : *.

but while running the ff schema i am getting like as follows

name: SampleRec
Age : Siva

And isValid : true.


What is the problem here, is there any settings issue. Please Help me.

Thanks

chrisl
05-10-2005, 07:38
Looks like you are sending your record name as one of the fields.
SampleRec*Siva*12345
Based on your example above you have 3 fields in SampleRec, Siva and 12345. Therefore your output is correct.
You need to add Recordname as the first field in your schema. Then ignore it in your processing.

To get the output you desire your data would have to look like this:
Siva*12345

Also set your field delimiter to newline and don't make it fixed length.

sivawithwipro
05-10-2005, 23:40
Hi,Can any body give me a sample variable length Flat file.

I have assumed one like as below.

9test*Siva


9- Length of the record
test- record name
*- field seperator
Siva- Field value


Is this a valid variable length flat file?

If not correct me .

Thanks

rmg
05-11-2005, 08:29
Siva,

What you are trying to achieve?

Hope you understood the above postings and thoughts by me and Chris.

carl
06-06-2005, 20:21
I have a single record type based flatfile schema with no record identifier. So I have defined a dictionary and assigned the same as default record type. This works pretty well and parses the records as desired. But it gives me the results as document array of

/ffvalues/recordWithNoId[].

For generalization purpose (with multi-record types) I need the docuement array in

/ffvalues/DETAILS[]

How do I get this? I tried the alternate name (in properties tab) stuff in vain.... any clues???

Thanks in advance

bash
08-08-2005, 09:35
After the parsing, map the contents of ffvakues/recordWithNoID[] to ffvalues/DETAILS[] using a MAP step and that should work