Page 1 of 1

Echo Absolute GDG Version

Posted: Fri Oct 05, 2018 2:01 pm
by tomltran7@gmail.com
When I send a file to the mainframe and a new GDG is created, I would like to echo the absolute GDG version that was created when the file transfer was a success. I have tried the following command below, however I get a blank value when there is a successful file transmission. Can you please assist?

echo `cozclient -in -ot catsearch $hlq.GDGNAME.* | tail -1`

Thanks!
TT

Re: Echo Absolute GDG Version

Posted: Tue Oct 09, 2018 8:34 am
by dovetail
What output do you get from this command?

cozclient -in -ot catsearch $hlq.GDGNAME.*

Re: Echo Absolute GDG Version

Posted: Tue Oct 09, 2018 11:32 am
by tomltran7@gmail.com
Thanks for the prompt response. When I run each cmd separately, the outputs are appearing correctly. step 1: connection established, step 2: list of GDG versions, step 3: Killed by signal 15.

>> cozcontrol start -t -ssh user@host.com
>> echo `cozclient -in -ot catsearch $hlq.GDGNAME.* | tail -1`
>>cozcontrol stop

But when I run the following commands in a script, no output is produced except for, "Killed by signal 15" . The script only contains the top 3 lines.

Thanks,
TT

Re: Echo Absolute GDG Version

Posted: Tue Oct 09, 2018 12:15 pm
by dovetail
It works fine for me:

Code: Select all

$ cat tcoz.sh
set -x
cozcontrol start -t -ssh kirk@zosdtl22
echo `cozclient -in -ot catsearch kirk.coztest.gdg.* | tail -1`
cozcontrol stop

$ ./tcoz.sh
++ cozcontrol start -t -ssh kirk@zosdtl22
+++ tail -1
+++ cozclient -in -ot catsearch 'kirk.coztest.gdg.*'
++ echo KIRK.COZTEST.GDG.G0001V00
KIRK.COZTEST.GDG.G0001V00
++ cozcontrol stop
Q1: What version of Co:Z are you running on your client and on z/OS?
Q2: Please try this, just like I have it, with the "set -x"

Re: Echo Absolute GDG Version

Posted: Tue Oct 09, 2018 8:22 pm
by tomltran7@gmail.com
A1: Current version we are using is 1.3.0 2017-07-24. The device OS is Linux on Z and we are attempting to transfer a file from our linux machine to a z/OS machine.

cozcontrol start -t -ssh userID@host.com

hlq=$1
ft=$2

for i in $(ls $hlq.abc.def.$ft*); do

fn=$i
dsn="//"${fn::-7}"(+1)"

todsn -o "recfm= ,lrecl= ,blksize=0,space=(cyl,(1,1))" $dsn < $fn

echo `cozclient -in -ot catsearch $hlq.abc.def.$ft* | tail -1`
done

A2: I applied the -x and I'm still receiving the same response when executing the cmds inside a script. I think it's the redirection that may be causing an issue. So meaning that the command is attempting to search locally on the linux machine and not on the mainframe. Can that be it?

Re: Echo Absolute GDG Version

Posted: Wed Oct 10, 2018 3:35 pm
by dovetail
Reduce your script to the minimum required to reproduce the problem and add:

set -x

to the beginning so that you can post a trace.