on 01-02-2008 9:44 AM
Hi,
I have 3 records Rec_A, Rec_B, Rec_C_D and each of this record having common strcuture of fields but with different occurances.
Rec_A -- EMPNO 1:1
JNDate 0:1
Dept 1:1
Rec_B -- EMPNO 1:1
JNDate 1:1
Dept 1:1
Rec_C_D -- EMPNO 1:1
JNDate 0:1
Dept 1:1
It is a Asterik(*) separated delimited file and end separator is New Line.
Depending on the Dept field, the record has to processed.
Ex: If the Dept value is C, then it has to process Rec_C_D and if Dept value is B, it has to process Rec_B Vice versa.
In Configuration I specified the FCC Parameters as follows :
*KeyFieldName : Dept*
Rec_A.fieldSeparator : *
Rec_A.endSeparatot : 'nl'
Rec_A.fieldNames: EMPNO,JNDate,Dept
Rec_A.keyFieldName: A
Similarly defined for Rec_B and Rec_C_D as well.
I gave my input file as follows :
12320080102A
345* *B
789* *A
14320080102C
Its reading only the two records ( First and last one) as I gave all the three fields in the input file.
If I miss any of the filed (although it is optional) its not processing that record.
Please give me some pointers to overcome this issue.
Regards,
Babu
got an answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas
I have found one mistake in the configuration u have done for the fcc:
u have mentioned
Rec_A.keyFieldName: A but u have to mention Rec_A.keyFieldValue: A similarlry for all records u have to do this.Secondly u have to specify a value for Recordset Name:Record(or any name which is root for all structure)
. i.e in IR ur structure should be
Record
recordA
fieldname....
recordB
fieldname...
recordC
fieldname...
plz do this modification and if it works then reward point.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas
I have found one mistake in the configuration u have done for the fcc:
u have mentioned
Rec_A.keyFieldName: A but u have to mention Rec_A.keyFieldValue: A similarlry for all records u have to do this.Secondly u have to specify a value for Recordset Name:Record(or any name which is root for all structure)
. i.e in IR ur structure should be
Record
recordA
fieldname....
recordB
fieldname...
recordC
fieldname...
plz do this modification and if it works then reward point.....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi sreeni!
try some dummy data and check to see all the records are being processed ( you can remove them in the mapping).
or try for FixedLength Field format, it will suite your need.
thanks,
nikhil
*reward if helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think u do need to create the three similar structure, only one structure is required.
Now u write the FCC for one strucutre and in the mapping then in the mapping u check which record data has to be mapped based on ur Dep condition.
Also u have mentioned the key field in FCC which is not required form ur test data which u have given below.
Also there should be one root element before the Rec.
Record--(0unbounded)
Emp--(01)
Jndate--(01)
Dep -
(0-1)
FCC will be
Record*
Record.fieldSeparator : *
Record.endSeparatot : 'nl'
Record.fieldNames: Emp,Jndate,Dep
Thats it
Thnx
Chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chirag,
Thanks for your reply.
The structure is not same for all the records.
The Occurances of the fields inside the record are different .
See the structure as below :
Rec_A -- EMPNO 1:1
JNDate 0:1
Dept 1:1
Rec_B -- EMPNO 1:1
JNDate 1:1
Dept 1:1
Rec_C_D -- EMPNO 1:1
JNDate 0:1
Dept 1:1
Regards,
Babu
Babu,
Can you make some changes in your test file (remove the additional * ) and then test it.
use these records and test.
12320080102A
345*B
789*A
14320080102C
I guess two * are creating the problem and this is the reason your first and last record is coming.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarvesh,
Thanks for the reply.
But JNDate is Mandatory in Rec_B.
But I did not specified data in that field rather I specified * to indicate that field is present.
I hope if we did not specify anything in that field it should take it as NULL as we specified the delimiter at the end of the field.
Regards,
Babu
No that is not correct, you can not have two * (one for field seprator and other for filed), See for mandatory field you need to do the validation in mapping rather than doing in file, coz in real time scenario when there will be thousands of records, then what will you do??
you just remove one * and then test or better just give som data and then test.
Regards,
Sarvesh
Hi Sarvesh,
You got me Wrong.
Here is the clarification :
<EmpNo> 123
<JNDate> NULL Value
<Dept>B
Input Data : 123*(delimiter end of first field) NULL Value *(end of second field) B (NL) end separator.
123* *A ( 2nd field is optional)
34520080201B ( All are mandatory)
I am getting only the second record, but its not reading the first record as there is blank in the input file.
Regards,
Babu
HI,
I am surprise, how ur file adapter pick the file as u r not using any key values and if ur using then can u pls tell me which is the key values for all the Rec.
I dont think creating the similar strucutre will help. Only one firled occurence is different other field occurence is similar in all the records.
Thnx
Chirag
Hi Chirag,
The Key Field value is Dept.
As I can have Dept value A,B,C or D in my input file.
If I encounter "A" in the input file, it will process that structure,
"B" , it will process the strucutre defined under B.
If I encoutner "C | D " , then it will process the structure defined under Rec_C_D.
Hope I am clear now .
Regards,
Babu
Hi,
Thats what I am trying to explain u.
If I encounter "A" in the input file, it will process that structure,
"B" , it will process the strucutre defined under B.
If I encoutner "C | D " , then it will process the structure defined under Rec_C_D.
This condition is used in Mapping when the file is picked up that time these chondition is not checked,
The file adapter will only generate the XML strucutre.
For example if u have Dept value A,B,C.......till Z then u do not create the 26 strucutre as a data type u just create only one strucutre which has Dep value either as A,B or any of them and in the mapping u will check whether if its A then generate target node with only A value.
I hope u got what i am trying to explain u.
Thnx
Chirag
Srinivasa,
Is there any spesific reason for having different occurrences for the same structures.
I am 100% agree with Chirag and he has given a good example for the same and is logical too.
If you are creating the scenario just for testing and exploring your knowledge then you have to create only one structure.
I hope you will be getting what we are trying to say.
Regards,
Sarvesh
Hi Chirag,
Thanks for your reply.
I tried with your option and the file is being picked up and I got the XML strucutre for all records.
But the requirement is in such a way that I need to create 4 different structures as the Occurances of the fields are differing from one record to other record.
So, I have no other chance other than creating 4 records and the problem Occurs when I did that.
Regards,
Babu
Hi Sarvesh,
Thanks for your reply.
This is not self-learning and as part of Project.
I tried with Chirag's option and the file is being picked up and I got the XML strucutre for all records(eventhough there is no data for some fields)
But the requirement is in such a way that I need to create 4 different structures as the Occurances of the fields are differing from one record to other record.
So, I have no other chance other than creating 4 records and the problem Occurs when I did that.
Regards,
Babu
1) First of all I did not understood ur requirement why u have kept the occurance of one element 0-1 and other 1-1.
2) What is the need of creating the three similar strucutre.
3) U can do the validation based on Dep value at in the mapping.
4) I need to create 4 different structures as the Occurances of the fields are differing from one record to other record.
-Why u need to create 4 different strucutre with same element as the data which each element hold is same.
Can u please answer to my questions so that I am get clear idea.
Thnx
Chirag
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.