For Programmers: Free Programming Magazines  


Home > Archive > Cobol > May 2007 > FTPing COMP-3 data from mainframe to UNIX









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author FTPing COMP-3 data from mainframe to UNIX
kimi

2007-05-24, 7:55 am

hi,

I am actually trying to ftp a PS file from mainframe to UNIX.

The contents of the PS file are data declared as S9(8) COMP-3 and
9(2).

When i ftp this file to UNIX in ASCII mode , i am able to read
the data declared as 9(2) as it
is but there is a erroneuos read as far as the COMP-3 data is
concerned.

When i ftp this file to UNIX in BINARY mode , i am able to read
the data declared as COMP-
3 as it is but there is a erroneuos read as far as the 9(2) data
is concerned.

The ftped data in UNIX is being read using a cobol program.
The cobol program is being compiled using the command "cob -iaPV
filename.cbl".
The cobol program is being run using the command "cobrun
filename.int".

The above commands are provided by microfocus.ie. the cobol
program is being executed
on a UNIX environment using MICRO FOCUS SERVER EXPRESS 4.0 SP2.

Pls let me know how i can read both the types of data
successfully.

Mjedtut

2007-05-29, 10:21 am

Why pay for membership at adult sites? Makes your video yourself! Just like I did, watch this full-size sample:
http://www.xx-amateur-movies.org/vid/218571/
William M. Klein

2007-05-30, 6:55 pm

If you have (IBM) mainframe files that you need to transfer to an ASCII (or
Unicode) environment *and* the files include a mixture of "character" and "COMP"
(binary or Packed) fields, then you MUST use a tool for successful data sharing.

Micro Focus (and others) have such tools. They require that you have a complete
"file description". This may be a "copybook" for the file layout - but does
need to include all redefines both at the 01-level and lower levels. There also
must be a way of "determining" which layout is in "use" for each record.

If this is a "one-off" (single file or single program) then you certainly can
"do this yourself" (code a COBOL program to do it). Otherwise, you can look for
a "tool" to do it for you.

The bottom-line is that this "tool" must do one of two things:

1) Convert all numeric fields to USAGE DISPLAY SIGN IS SEPARATE
(then the conversion of the file is easy)
or
2) You need to transfer" in binary and have the tool "convert" only the
character data between EBCDIC and ASCII

P.S. Different COBOL compilers use different rules for how they handle signs of
packed fields even when running in ASCII mode. Micro Focus, for example, has
CHARSET(ASCII/EBCDIC) vs SIGN(ASCII/EBCDIC).

Finally, if you have a compiler (such as Micro Focus) that allows you to run
your ENTIRE application on the Unix/PC system in EBCDIC, then you may want to
consider just downloading your file in BINARY and running in EBCDIC on the
workstation. You won't be able to share such files (intelligently) with other
PC/Unix applications, but this may be the easiest way for some work to be done.

--
Bill Klein
wmklein <at> ix.netcom.com
"kimi" <mraghu83@gmail.com> wrote in message
news:1179986951.644733.282750@a35g2000prd.googlegroups.com...
> hi,
>
> I am actually trying to ftp a PS file from mainframe to UNIX.
>
> The contents of the PS file are data declared as S9(8) COMP-3 and
> 9(2).
>
> When i ftp this file to UNIX in ASCII mode , i am able to read
> the data declared as 9(2) as it
> is but there is a erroneuos read as far as the COMP-3 data is
> concerned.
>
> When i ftp this file to UNIX in BINARY mode , i am able to read
> the data declared as COMP-
> 3 as it is but there is a erroneuos read as far as the 9(2) data
> is concerned.
>
> The ftped data in UNIX is being read using a cobol program.
> The cobol program is being compiled using the command "cob -iaPV
> filename.cbl".
> The cobol program is being run using the command "cobrun
> filename.int".
>
> The above commands are provided by microfocus.ie. the cobol
> program is being executed
> on a UNIX environment using MICRO FOCUS SERVER EXPRESS 4.0 SP2.
>
> Pls let me know how i can read both the types of data
> successfully.
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com