Page 1 of 1

Echo Absolute GDG Version

Posted: Fri Oct 05, 2018 2:01 pm
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`


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
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
>> 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.


Re: Echo Absolute GDG Version

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

Code: Select all

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

$ ./
++ cozcontrol start -t -ssh kirk@zosdtl22
+++ tail -1
+++ cozclient -in -ot catsearch 'kirk.coztest.gdg.*'
++ echo 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
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


for i in $(ls $$ft*); do


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

echo `cozclient -in -ot catsearch $$ft* | tail -1`

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.