Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FTP from COBOL

3 views
Skip to first unread message

Carol Srna

unread,
Mar 17, 2004, 9:40:56 AM3/17/04
to
Hello Gentle Listers.

Someone wanted me to pose this question to the List.

How, if possible, do you call FTP from a COBOL program?
TIA

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Jim McAlpine

unread,
Mar 17, 2004, 10:16:59 AM3/17/04
to

Carol Srna <carol...@LA-Z-BOY.COM> wrote:

How, if possible, do you call FTP from a COBOL program?

---------------------------------------------------------------------------------------

Carol, you have to write a small assembler program and issue the ATTACH macro to attach the FTP program. This is required because the FTP program needs to run in POSIX(ON) mode - see PQ28381. Then you CALL the assembler program from COBOL passing the HOSTNAME as the only parameter. All other ftp parameters are read in from the //INPUT DD statement. I have some code if you require it.

Jim McAlpine

---------------------------------
Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now

Kittendorf, Craig

unread,
Mar 17, 2004, 11:11:16 AM3/17/04
to
Yes, Jim Keohane had an article on Search390.com a few years ago. It may
still be there or on his site:
http://www.multi-platforms.com/


-----Original Message-----
From: Carol Srna [mailto:carol...@ibm-main.LA-Z-BOY.COM]
Sent: Wednesday, March 17, 2004 9:41 AM
To: IBM-...@BAMA.UA.EDU
Subject: FTP from COBOL

Hello Gentle Listers.

Someone wanted me to pose this question to the List.

How, if possible, do you call FTP from a COBOL program?
TIA

Carol Srna

unread,
Mar 17, 2004, 11:22:55 AM3/17/04
to
Thanks all for responding. I am looking at Jim K's. "Bill the Cat - OOP
ACK..." :-)

Jim Keohane

unread,
Mar 17, 2004, 11:27:05 AM3/17/04
to
Carol,

Visit www.search390.com and do a search for ftpfront (upper right).

You'll get 3 hits consisting of my tips and a Q&A that include COBOL
code to invoke FTP.

They are:

OOP ACK ACK Fttttttpppppppppppppppppppppp!!!!!!!!!
at <http://search390.techtarget.com/tip/1,289483,sid10_gci550566,00.html>.

Horrible things COBOL can do with IDCAMS!
at <http://search390.techtarget.com/tip/1,289483,sid10_gci539649,00.html>.

Can FTP be called from a COBOL 390 program?
at
<http://search390.techtarget.com/ateQuestionNResponse/0,289625,sid10_cid519769_tax285123,00.html>.


- Jim

Jim Keohane

unread,
Mar 17, 2004, 11:27:25 AM3/17/04
to
Jim,

I was able to bypass this problem with COBOL invoking FTP without the
need of an assembler subroutine noir any multi-tasking. I changed the COBOL
code, when dynamically CALLing FTP, to pass a PARM like

'POSIX(OFF) / SERVER.NODE (EXIT'

The POSIX(OFF) did the trick.

See code in:

OOP ACK ACK Fttttttpppppppppppppppppppppp!!!!!!!!!
at <http://search390.techtarget.com/tip/1,289483,sid10_gci550566,00.html>.

Also see ***LATE FLASH*** code appended at bottom of:

Horrible things COBOL can do with IDCAMS!
at <http://search390.techtarget.com/tip/1,289483,sid10_gci539649,00.html>.

- Jim


At 10:16 2004-03-17, you wrote:


>Carol Srna <carol...@LA-Z-BOY.COM> wrote:
>
>How, if possible, do you call FTP from a COBOL program?

>---------------------------------------------------------------------------------------
>
>Carol, you have to write a small assembler program and issue the ATTACH
>macro to attach the FTP program. This is required because the FTP program
>needs to run in POSIX(ON) mode - see PQ28381. Then you CALL the assembler
>program from COBOL passing the HOSTNAME as the only parameter. All other
>ftp parameters are read in from the //INPUT DD statement. I have some
>code if you require it.
>
>Jim McAlpine
>
>
>
>---------------------------------
> Yahoo! Messenger - Communicate instantly..."Ping" your friends today!
> Download Messenger Now
>

Jim McAlpine

unread,
Mar 17, 2004, 12:32:18 PM3/17/04
to

Jim Keohane <jim...@MULTI-PLATFORMS.COM> wrote:


I was able to bypass this problem with COBOL invoking FTP without
the need of an assembler subroutine noir any multi-tasking. I changed the COBOL code, when dynamically CALLing FTP, to pass a PARM like

'POSIX(OFF) / SERVER.NODE (EXIT'

The POSIX(OFF) did the trick.

--------------------------------------------------------------------------------------------------

Jim, well that's strange because PQ28381 says that the FTP client has to run in POSIX(ON) mode and I remember finding that apar because I got the exact same symptoms described by it. However, running with POSIX(OFF) does now work as your tip says. I can only think that the behaviour has changed. It was some years ago when I first tried it.

0 new messages