Misaligned Records after reading Mainframe File
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
Misaligned Records after reading Mainframe File
I am trying to read a mainframe file (Data format: EBCDIC, Record Style CR/LF). In my job, I read the file using CFF stage. Then using a tranformer, I check for the first field (rec_type). If its 206, I pass it on, else reject. Unfortunately, when I view data in CFF stage, I see that some records have been misaligned due to which more than the expected number of records are being rejected. I would like to know what is causing the misalignment. Also, the columns description pertains only to the body of the file. The first record in the file is a header which doesn't have the same fields as do the rest of the records. The only field that matches with the body is the first field(rec_type).
I believe that my column description is right because 250 out of 258 records are cleanly passed through. Instead of rejecting only 1, 7 more records are rejected.
Thanks for your patience and time.
I believe that my column description is right because 250 out of 258 records are cleanly passed through. Instead of rejecting only 1, 7 more records are rejected.
Thanks for your patience and time.
Attitude is everything....
-
- Premium Member
- Posts: 209
- Joined: Fri Jan 09, 2004 1:14 pm
- Location: Toronto, Canada
- Contact:
Re: Misaligned Records after reading Mainframe File
Hi Geeks,
Can you see that the 7 incorrectly rejected records have '206' as the first characters?
Are these characters a string or are they a COMP numeric field?
Rob W
Can you see that the 7 incorrectly rejected records have '206' as the first characters?
Are these characters a string or are they a COMP numeric field?
Rob W
Rob Wierdsma
Toronto, Canada
bartonbishop.com
Toronto, Canada
bartonbishop.com
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
Re: Misaligned Records after reading Mainframe File
rwierdsm wrote: Can you see that the 7 incorrectly rejected records have '206' as the first characters?
Are these characters a string or are they a COMP numeric field?
Rob W
The rejected records do not have 206. Instead they are some garbage numbers. The characters' native type is binary of length 2. Yes it is a COMP numeric field.
Attitude is everything....
-
- Premium Member
- Posts: 209
- Joined: Fri Jan 09, 2004 1:14 pm
- Location: Toronto, Canada
- Contact:
Re: Misaligned Records after reading Mainframe File
When you read the file up on the mainframe, do the offending records have 206 in the file type position, or are they also corrupted up there?
Rob Wierdsma
Toronto, Canada
bartonbishop.com
Toronto, Canada
bartonbishop.com
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
Mainframe: Data Type: EBCDIC; Record Style: Binary
![Image](http://img187.imageshack.us/img187/584/mainframeyw1.jpg)
It is designed as above. I made a few changes. I now have two output links. Depending on the selection criteria, (if REC_TYPE is 105 or 106) the records go to either of the links. It now works without any misalignment, However some the of fields in some body records are empty. The REC_TYPE field is non-empty though. The mainframe guy confirmed that there are no empty fields in any records.
Since this approach was not working, I decided to do things in a different way. I requested the mainframe guy to send me a file without CR/LF. Correspondingly, I changed the record style to Binary in the CFF stage. Now the header record is pulled out beautifully however no body records are pulled out.
Thank you for your time.
Attitude is everything....
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This post appears to duplicate this issue. Please delete the duplicate post. Meanwhile, still waiting to see the COBOL FD that you loaded into the Complex Flat File stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
I think the only way I can get the problem across in the shortest time is to let you see the job and the mainframe file. I have posted the job, and two source files. One called the header file contains the header and the other called the no_header file doesn't contain the header .ray.wurlod wrote:Can you please post the COBOL File Definition? There's something you're not telling us, which is making it impossible to guess accurately.
The job extracts body and header. If I feed the no_header file, the body is extracted completely. If I feed the header file, only the header is extracted.
My question is, how do I extract the body and the header from the header file?
http://www.filefactory.com/file/6c4352/ JOB
http://www.filefactory.com/file/e80491/ Header file
http://www.filefactory.com/file/efac75/ No Header file
Attitude is everything....
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
Please try this format. Ask the mainframe people to give it in binary format. Then in your meta data structure, you mark the fields that are having date or decimal to comp3. And try it. If it is not working please send me your COBOL file structure in a text file.
Best Regards,
Best Regards,
Best Regards,
Thiruma Valavan
Thiruma Valavan
just4geeks wrote:http://www.filefactory.com/file/6c4352/ JOB
http://www.filefactory.com/file/e80491/ Header file
http://www.filefactory.com/file/efac75/ No Header file
![Confused :?](./images/smilies/icon_confused.gif)
Why not just post the FD here? Wrap it in 'code' tages to preserve the formatting. It's ok, we've seen worse - go for it.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA
Sorry about that. I should have done a bit more testing. Anyway here is the link.chulett wrote:Do these links work for anyone?
http://www.yousendit.com/download/2VfiCAhRwLh5TA%3D%3D
to download the source files and the job. My only favor to ask of you is to enable pop-up blocking.
My next post will carry the FD. I am currently working on that.
Last edited by just4geeks on Sun Jan 07, 2007 12:32 pm, edited 1 time in total.
Attitude is everything....
-
- Premium Member
- Posts: 644
- Joined: Sat Aug 26, 2006 3:59 pm
- Location: Mclean, VA