Author |
Message
|
djeripo |
Posted: Wed Apr 21, 2004 5:15 am Post subject: Dynamically reading Header Value |
|
|
 Master
Joined: 25 Jan 2004 Posts: 225
|
Hi,
I have an requirement .In that i will get multiple records in a flat file .
All records have same size.In the begining of the file , I will get header information saying how many data records i will be getting .
for eg: header80 .Can anybody tell me how to read that header count dynamically and update in the Messages----->Connection------>Max Occurs.
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 21, 2004 5:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to structure your model so that the repeat count is dependant on the integer header field that contains the number of records.
The model must be structured so that the count field is at the same hierarchical level as the element that repeats. Like this:
- MessageRoot
- Header
- HeaderField1
- ...
- RecordRepeatCount
- ...
- HeaderFieldN
- Record
- RecordField1
- ...
- RecordFieldN
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
djeripo |
Posted: Wed Apr 21, 2004 2:56 pm Post subject: |
|
|
 Master
Joined: 25 Jan 2004 Posts: 225
|
Thanks Jeff . May be I have not framed my question properly .Let me put it this was , A file would be read and put into a LocalQueue by a MQPUT program.
My data seems something like this,
count2"ABCDUO8014989 039MNE199804300K A97 00 A00010000000N10000PN000000001FUNDUO801498900001029698""ABCDUO8014990 077FCA199803300K A95 00 B00015107000N10000PN000000001
FUNDUO801499000010477280"
( "" is included for clarity sake )
here count2 indicates that this dataset(record) is repeating 2 times .In the realtime count would be somewhere around 20000 .
Data corresponds to the various fields like,
ABCD -HolderName
UO - Customer Reference etc etc....
My question how and where to mention this count value in the Message Set.Sorry for the confusion. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 21, 2004 3:14 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No confusion, that I know of.
You need to structure your model in the manner that I indicated in order for this to work at all.
Then, on the element in your model that corresponds to the element I called "Record" (which should be an element of a complex type, and not an instance of the complex type), you need to set the repeating properties to indicate that the repeating count is specified by the field in your model that corresponds to the element I called "RecordRepeatCount" (which must be an Integer element).
If you are unsure of the particular property you need to set, please consult the Working With Messages manual. I no longer have local copies of the 2.1 manuals, and so can't look it up any quicker than you can. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
djeripo |
Posted: Thu Apr 22, 2004 3:40 pm Post subject: |
|
|
 Master
Joined: 25 Jan 2004 Posts: 225
|
Perfect .Thanks Jeff.It worked.To achive this ,Under connection Repeat should be set to yes.Under CWF Repeat Count Type has to be changed to
Value Of from Count .Under Repeat Count Value of 'count' should be give.
n.b: Repeat Count Type becomes active only after making Repeat Yes |
|
Back to top |
|
 |
|