Page 1 of 1

Mainframe MVS File to SF/CFF stage. Values Incorrect

Posted: Wed Feb 08, 2006 3:31 pm
by dcguuenther
So here is my problem.

I have to bring a file that is stored on a MVS mainframe server and load it into a DB2 table.

I have FTP'd the file over directly onto the UNIX box.

I have a Cobol copybook directly from the mainframe that the mainframe uses to interpret the File.

Part of the copybook reads as follows.

05 CUSTOMER PIC 9(06) COMP-3.
05 MKT-DIVISION PIC X(02).

I have imported the copybook into Datastage, and used it to load the source SF/CFF stage (I have tried both).

Datastage's metadata says the Customer field is brought in as a Decimal 6
Datastage's metadata says the MKT-DIVISION is brought in as a Char 2.

I cannot read the correct Customer number into Datastage. There is an inherent default specified for import/export problems of columns and that is the value I see.

Moreover, I am not sure what default settings I need to view these things correctly. When I load the copy book, the SF/CFF stage says the data is EBCDIC - binary. If I try to view data in datastage based on that ---- I see a bunch of jibbersh. If I change the defaults to ASCII-text. I can see values properly in all of my columns -- except anything other than char datatypes is displayed incorrectly (meaning I am seeing that defauly value).

What do I need to do differently? I pulled the copybook right off the mainframe myself --- I have used that copybook on the mainframe to interpret the file and then I see the correct values. I am confused why Datastage is not doing this right now. Any advice, next steps to provide would be greatly appreciated.

Also, if you know of any other options on how to FTP this differently, if there is a way to make it comma separated before it comes over or anything --- please help. I no nothing of mainframe and am learning as I go.

Thanks so much.

Dan

Posted: Sun May 28, 2006 8:00 pm
by Chuah
Hi,
I'm quite interested in whether you have managed to solve this problem you had ? If so what did you have to do in DS to address this ?
I'll be starting work on a similar sort of project to extract from mainframe to DB2.
Thanks in advance.

Nick

Mainframe MVS File to SF/CFF stage. Values Incorrect

Posted: Tue May 30, 2006 5:33 am
by ashwin141
Hi

Did you change the Data from EBCIDIC to ASCII while FTPing it to Unix box?

Posted: Wed May 31, 2006 5:42 am
by thurmy34
Hi
You have to do your ftp in binary mode.

Posted: Fri Jun 02, 2006 8:32 am
by bcarlson
I keep a 'post-it note' in Outlook with the COBOL->DataStage mapping, because I always forget. Anyway, here is the mapping that we have used with success:

Code: Select all

Torrent/DataStage - COBOL Datatype  Mapping

PIC 9(02) - uint16 / int16 {text} or string[2, padchar=' '];
PIC S9(02) - int16 {text} or string[2, padchar=' '];
PIC 9(9)V99 - decimal[11,2] {zoned};
PIC S9(9)V99 COMP-3 - decimal[11,2] {packed};
PIC S9(9) COMP - int32.  Note: size of int is dependent on input size.  Determine largest value the input type could hold, then determine where it fits: int8, int16, int32 (or uint it not signed).
Assuming you are transfering your data in binary mode (so that EBCDIC to ASCII conversion can be handled within DataStage), you will need to import your customer field as decimal(6,0) with the packed option set to true. When you created your file layout, did you import the copybook and let DataStage create the metadata or did you create it manually? I am just curious why the 'packed' option wasn't set automatically.

By the way, make sure the format of the file is specified as EBCDIC and fixed length (Sequential File Stage : Output / Format tab).

Here are some other postings out there that may prove helpful:
HTH,

Brad.