Using STDIN with cozclient command

General discussion of the Co:Z Toolkit
Post Reply
sctebnt
Posts: 30
Joined: Mon Nov 02, 2009 10:47 pm

Using STDIN with cozclient command

Post by sctebnt »

I am attempting to use the cozclient, but would like to pass the command data via STDIN. I use the -it option to inform cozclient that my STDIN should be used and contains text. However I receive an error from CoZ that seems to be around translation of the text. Should I be using a different option?

Here is the code I run:

Code: Select all

echo 'some text'|cozclient -it mylog.sh 
Here is the message returned in SDTERR:

Code: Select all

cozserver(4)[E]: Error setting conversion for stdin(819->1047): EDC5113I Bad file descriptor. (errno2=0x05350222)
cozserver(4)[E]: Note: stdin conversion is not available on sockets
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Which version of the Co:Z Toolkit are you using?
Which version of z/OS?
Are you running cozclient via Co:Z Launcher?
If Co:Z Launcher, what is your setting for the "ssh-tunnel" property?
sctebnt
Posts: 30
Joined: Mon Nov 02, 2009 10:47 pm

Post by sctebnt »

We are running CoZ version 1.8

We are at ZoS version 1.11 this week (moving to 1.12)

We are runnign cozclient via CoZ Launcher

We have ssh-tunnel set to false
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

I suspected this as the problem.

Currently, the Co:Z client when executed under the launcher with SSH tunneling off doesn't support text translation of stdin.

A workaround for this would be to do this:

Code: Select all

echo 'some text' | iconv -f ISO8859-1 -t IBM-1047 | cozclient -ib mylog.sh
If logging is what you want, you can use the Co:Z z/OS "wto" shell command remotely using cozclient.

Just create a shell script on the target server in the PATH called "wto" with this:

Code: Select all

#!/bin/sh
cozclient -in -et wto "$@"
Then you will have a remote version of this command:
http://dovetail.com/docs/coz/dsp-ref_wto.html

Which you can use in on the target server like this:

Code: Select all

wto -r 1 'Here is a console message that will even wrap to multiple lines if required'
Post Reply