Problem reading Mainframe EBCDIC 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

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

Problem reading Mainframe EBCDIC file

Post by just4geeks »

I am having a problem with complex flat file stage.

I am using Complex flat file stage to extract header and body off of a mainframe file. (EBCDIC format and Binary Record Style, NO CR/LF). The criteria for extraction is value contained in the first field.

It so happens that only one of header or body is extracted. I think I can get the problem across sooner and clearer if you see it yourself.

Here is the link to download the job and the source files. Please enable pop-up blocker before opening the link.
http://www.yousendit.com/download/2VfiCAhRwLh5TA%3D%3D


There are two source files.

The header file contains body and header
The no_header file contains only body.

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?

Thank you for your time and patience.
Attitude is everything....
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If you use the metadata for the body and if you try to extract the header and body, dont you get the header getting rejected?
Sorry I dont have access to Datastage at the moment. Is your header and body are of same fixed length?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Post by just4geeks »

Thanks for your response.
kumar_s wrote:If you use the metadata for the body and if you try to extract the header and body, dont you get the header getting rejected?
Sorry I dont have access to Datastage at the moment. Is your header and body are of same fixed length?
There are two output links for the Complex flat file stage. One extracts header and the other extracts body. In the output tab of the complex flat file stage properties, there is a dropdown list which shows the two links. I have put down the column descriptions for each of the links. So, the metadata exists for both header and body.


No, the header and body are of different length. But I think its only reasonable to expect them to be of different lengths. Shouldn't the complex flat file stage be able to work it out itself given that the column descriptions are fed into it?
Attitude is everything....
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Dont you get any error or warning message? What happens if you have design to extract body and pass the file with header and body?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi,
Do you set the Start/End Record fields in the selection Criteria tab.
Start=1 End=1 for the header
Start=2 End=0 for the Body.
Hope This Helps
Regards
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Post by just4geeks »

thurmy34 wrote:Hi,
Do you set the Start/End Record fields in the selection Criteria tab.
Start=1 End=1 for the header
Start=2 End=0 for the Body.

Start=2 End=0 for the Body is an invalid combination. I then tried Start=2 End=2 for the Body. But NO Success either.
Attitude is everything....
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi
Sorry for the miscue.
I just want to check the value of this fields.
For the body it's Start=2 End=9999999999999999999 (to be sure to proceed all the rows).
I just download your job, rewrite it and i have one header and 33
bodies in my results file.
By the way you can do the same thing with one link a tranformer and a constraint on the rec_id.
Hope This Helps
Regards
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi
Sorry for the miscue.
I just want to check the value of this fields.
For the body it's Start=2 End=9999999999999999999 (to be sure to proceed all the rows).
I just download your job, rewrite it and i have one header and 33
bodies in my results files.
By the way you can do the same thing with one link a tranformer and a constraint on the rec_type.
Hope This Helps
Regards
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Post by just4geeks »

thurmy34 wrote:For the body it's Start=2 End=9999999999999999999
I typed the exact same number of 9's and I got this error message, "End Record # must be equal to or greater than Start Record #".

Then I filled 9999, and I got no error but no body records either. Also, I confirmed with the mainframe guy and there are 825 body records in the file.

Can you tell me what other changes did you make such that you got 33 body records?

Thanks for your response.
Attitude is everything....
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Try 827. Have you tried passing the Header and Body file into CFF stage which has only Body metadata with a Reject option enabled?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
just4geeks
Premium Member
Premium Member
Posts: 644
Joined: Sat Aug 26, 2006 3:59 pm
Location: Mclean, VA

Post by just4geeks »

kumar_s wrote:Try 827. Have you tried passing the Header and Body file into CFF stage which has only Body metadata with a Reject option enabled?
Unfortunately, 827 didn't work either. I tried but couldn't find the reject option in CFF stage? Can you please tell me what tab is it in?
Attitude is everything....
thurmy34
Premium Member
Premium Member
Posts: 198
Joined: Fri Mar 31, 2006 8:27 am
Location: Paris

Post by thurmy34 »

Hi
Sorry for being so long but I had some issue with my account.

When I rewrote the job I use your files (no_header.txt and header.txt) and in the header.text I have 1 header and 33 Bodies.

The selection criteria tab is set with (for the header link)
Start Record=0 and End record=0
ID Fields=Rec_Type Value=201

The selection criteria tab is set with (for the body link)
Start Record=0 and End record=0
ID Fields=Rec_Type Value=206
Hope This Helps
Regards
Post Reply