Misaligned Records after reading Mainframe File

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Misaligned Records after reading Mainframe File

Post 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.
Attitude is everything....
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: Misaligned Records after reading Mainframe File

Post 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
Rob Wierdsma
Toronto, Canada
bartonbishop.com
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Re: Misaligned Records after reading Mainframe File

Post 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.
Attitude is everything....
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Re: Misaligned Records after reading Mainframe File

Post 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?
Rob Wierdsma
Toronto, Canada
bartonbishop.com
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Mainframe: Data Type: EBCDIC; Record Style: Binary

Post 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.
Attitude is everything....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So you can mark this thread as resolved?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Post 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.
Attitude is everything....
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Post 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
Attitude is everything....
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Post by just4geeks »

ray.wurlod wrote:Please delete the duplicate post.
The duplicate post has been deleted.
Attitude is everything....
thirupri
Premium Member
Premium Member
Posts: 40
Joined: Wed Sep 17, 2003 3:41 am
Location: Saudi Arabia
Contact:

Post 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,
Best Regards,
Thiruma Valavan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Post 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.
Last edited by just4geeks on Sun Jan 07, 2007 12:32 pm, edited 1 time in total.
Attitude is everything....
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Post 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.
Attitude is everything....
Post Reply