Page 1 of 2

Misaligned Records after reading Mainframe File

Posted: Fri Jan 05, 2007 10:58 am
by just4geeks
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.

Re: Misaligned Records after reading Mainframe File

Posted: Fri Jan 05, 2007 11:02 am
by rwierdsm
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

Re: Misaligned Records after reading Mainframe File

Posted: Fri Jan 05, 2007 11:18 am
by just4geeks
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.

Re: Misaligned Records after reading Mainframe File

Posted: Fri Jan 05, 2007 11:37 am
by rwierdsm
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?

Mainframe: Data Type: EBCDIC; Record Style: Binary

Posted: Fri Jan 05, 2007 2:25 pm
by just4geeks
Image
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.

Posted: Fri Jan 05, 2007 2:51 pm
by ray.wurlod
So you can mark this thread as resolved?

Posted: Fri Jan 05, 2007 3:07 pm
by just4geeks
ray.wurlod wrote:So you can mark this thread as resolved?
I am sorry if I meant that the problem is resolved in my last post.

The issue is still open. I should get some body records. On the other hand, I am getting nil.

Please advise.

Posted: Fri Jan 05, 2007 9:33 pm
by ray.wurlod
Can you please post the COBOL File Definition? There's something you're not telling us, which is making it impossible to guess accurately.

Posted: Fri Jan 05, 2007 9:41 pm
by ray.wurlod
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.

Posted: Fri Jan 05, 2007 9:53 pm
by just4geeks
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.
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 .

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

Posted: Fri Jan 05, 2007 10:26 pm
by just4geeks
ray.wurlod wrote:Please delete the duplicate post.
The duplicate post has been deleted.

Posted: Sun Jan 07, 2007 2:47 am
by thirupri
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,

Posted: Sun Jan 07, 2007 8:42 am
by chulett
:? Do these links work for anyone? All I get are a bunch of crappy pop-ups and the File Factory homepage. If I need to register there just to view them, sorry but forget it.

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:

Posted: Sun Jan 07, 2007 11:08 am
by just4geeks
chulett wrote:Do these links work for anyone?
Sorry about that. I should have done a bit more testing. Anyway here is the link.
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.

Posted: Sun Jan 07, 2007 11:44 am
by just4geeks
chulett wrote:Why not just post the FD here?
By FD, do you mean the table definitions for header and body? I am a beginner here. How do I save table defs in txt format?

Thank You.