I am having a problem with a PUT command that is currently spanning two lines in FTP, that I am converting to SFTP:
Current Command:
put //TEMP.G05DIRF.ENGFRE.big.mvsp +
g05dirf.sftp.big.mvs.txt1
Results:
cozsftp> lzopts mode=text,notrim
mode=text notrim
cozsftp> cd Outbox
cozsftp> put //TEMP.G05DIRF.ENGFRE.big.mvsp +
Uploading //TEMP.G05DIRF.ENGFRE.BIG.MVSP to /Outbox/+
ZosSettingsÝI¨: Transfer options: clientcp=IBM-1047,mode=text,servercp=ISO8859-
ZosDatasetÝI¨: Opening dataset TEMP.G05DIRF.ENGFRE.BIG.MVSP for read with optio
ZosDatasetÝI¨: Closing dataset //TEMP.G05DIRF.ENGFRE.BIG.MVSP - 0 records read,
Ý17.575¨ Invalid command.
cozsftp> g05dirf.sftp.big.mvs.txt1
CoZBatchÝI¨: returning rc=exitcode=1
Problem with Put Statement Longer than 72 characters
Re: Problem with Put Statement Longer than 72 characters
When you run the SFTPPROC, the SFTPIN DD input is processed by the z/OS Unix shell.
To continue lines in the z/OS Unix shell, you can use a trailing backslash '\' character
For example:
To continue lines in the z/OS Unix shell, you can use a trailing backslash '\' character
For example:
Code: Select all
put //TEMP.G05DIRF.ENGFRE.big.mvsp \
g05dirf.sftp.big.mvs.txt1
Re: Problem with Put Statement Longer than 72 characters
Not to revive an old thread, but was this fixed in a certain release or version? currently running the SFTPPROC for CoZBatch on 4.2.0 and it appears the line continuation character does no work as described.
Can anyone else verify this?
Can anyone else verify this?
Re: Problem with Put Statement Longer than 72 characters
I have been able to get this by using a heredoc (<<EOB/EOB). without it , the line continuation will not work.
Re: Problem with Put Statement Longer than 72 characters
Try adding "set -x" to the beginning of your shell script, which should product a shell script trace that is often useful.
Re: Problem with Put Statement Longer than 72 characters
Thank you. That is good to know. Personally I have been trying to shy away from using the shell scripts and providing the commands directly to COZBATCH. I dont know if it recommended or supported, but i have yet to run into an issue doing it in this fashion that the scripts got me around. The only thing was a heredoc is required if you have to use a line continuation. To me it appears more straight forward, but i do not have a shell scripting background.
where WM.Q2.COZ.PARMLIB(SFTPENV) contains modified cards from the SFTPIND member in the Samplib
Code: Select all
//*-------------------------------------------------------------------
//* COZPUT - put a file using Coz SFTP.
//*-------------------------------------------------------------------
//COZPUT EXEC PGM=COZBATCH,REGION=0M
//SYSTSPRT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//STDIN DD DSN=WM.Q2.COZ.PARMLIB(SFTPENV),DISP=SHR
// DD DDNAME=BATCHIN
//BATCHIN DD DATA,DLM='²Ó'
-P 2200 ccoody@sp04ftp
ls /+mode=text,lrecl=80,recfm=fb,space=cyl.1.5
-rm //CCOODY.TEST.FILE
-put //CCOODY.SP.PARMLIB.V1(DONKEY) //CCOODY.TEST.FILE
quit
²Ó
/*
Code: Select all
/usr/local/coz/bin/cozsftp -oConnectTimeout=60 \
-oServerAliveInterval=60 \
-oNumberOfPasswordPrompts=1 \
-oStrictHostKeyChecking=yes \
-b- \
Re: Problem with Put Statement Longer than 72 characters
COZBATCH just starts the z/OS Unix shell (/bin/sh), so your input is a shell script.
BTW: we have some sample PROCs and scripts for running Co:Z SFTP in batch that we recommend you try:
https://dovetail.com/docs/sftp/client.h ... batch_samp
BTW: we have some sample PROCs and scripts for running Co:Z SFTP in batch that we recommend you try:
https://dovetail.com/docs/sftp/client.h ... batch_samp