ftp mode

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
fmou
Participant
Posts: 124
Joined: Sat May 28, 2011 9:48 pm

ftp mode

Post by fmou »

Hi,

I heard the saying that

- source data from mainframe dataset should be ftped using the binary mode, whereas
- COBOL copybook files should be ftped using th text mode

I'm wondering if the above absolutely necessary? what'd happen otherwise. what's the general guild-line choosing the ftp mode.

thanks
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Mainframe files typically contain non-character data (integers, packed decimal primarily) which would likely be corrupted if the ASCII (text) transfer type is used with FTP. The ASCII/text transfer mode will also convert EBCDIC characters to ASCII (this is the source of the corruption of non-character data).

COBOL copybooks are text files which are included during the compilation of a COBOL program (similar to #include in C/C++). Usually they can be safely transfered using ASCII/text mode.

Rule of thumb on almost all platforms: If you are absolutely certain that there is NO non-character data in a file, you are USUALLY safe using the ASCII/text transfer mode. Otherwise, use the binary transfer mode to avoid possible data corruption.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
fmou
Participant
Posts: 124
Joined: Sat May 28, 2011 9:48 pm

Post by fmou »

many thanks for the explanation of why those mode are chosen.

Are COBOL copybooks normally of EBCDIC characters?

thanks
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

Last question first: a copybook is just the COBOL version of a schema. It's programming code, specifically names of fields and their attributes. The character set is not relevant at that level.

James provided a good answer, and this is my two cents about an additional point specific to DataStage.

Mainframe files should be read -- unless your shop has unusual things going on -- as binary data directly into the table definition created from importing the COBOL copybook. Further, the record type should be set to implicit. In fact, if you clear the settings on the Format tab, right click on Record level and select down on "Format as" to "Mainframe (COBOL)", you will have the default format settings you need. Your FTP stage handles the rest.

I strongly recommend learning by doing. Create a simple job to read a mainframe file using FTP Enterprise. Import your copybook as "COBOL file definitions" and let DS be your guide.

Good luck.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Post Reply