Using todsn to go directly to Sysout

General discussion of the Co:Z Toolkit
Post Reply
jacobsm
Posts: 37
Joined: Thu Apr 23, 2009 9:18 am
Location: Tampa, Florida

Using todsn to go directly to Sysout

Post by jacobsm »

I've been successful using todsn sending a file from my workstation directly to sysout

#!/bin/sh
cat $1 | todsn -ssh aimj@tcs1 -r -x 'ALLOC SYSOUT(A) ' "'//$2'"

Now I'm trying to use JES2 metadata like title, forms and so on using the OUTDES keyword passing it in the -x parameter field. Haven't been able to figure out how to pass both OUTDES setting the metadata and then an ALLOC specifying the just defined OUTDES settings to the BPXWDYN service.

Does anyone know a way to do so?

Mark Jacobs
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Using todsn to go directly to Sysout

Post by dovetail »

When you use the "-x", you shouldn't specify the "alloc" keyword. Also, when specifying "sysout" as a keyword, the name of the target dataset is not actually used, but you need to supply something.

So, try this:

Code: Select all

cat $1 | todsn -ssh me@zos -x 'sysout(a)' //sysout
If you are just sending a file, you could also use redirection rather than a pipe:

Code: Select all

todsn -ssh me@zos -x 'sysout(a)' //sysout  < $1 
Then, if you want to use other BPXWDYN keywords along with sysout, you can specify them like this:

Code: Select all

todsn -ssh me@zos -x 'sysout(a) outdes(foo) forms(xxyy)' //sysout  < $1 
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Using todsn to go directly to Sysout

Post by dovetail »

This is a little OT for your question, but I'll take the opportunity to mention something really cool if you are using Linux or Unix as your client (Windows cygwin won't work currently).

So, basically there are two steps:

1) On your client (usually your desktop), you configure your OpenSSH client to use "Control/Master" sessions, like this:
http://www.linuxjournal.com/content/spe ... ame-server

after doing this, then I usually log in with a shell session to z/OS and leave it open. This would be the "master" ssh session.
After that, then any ssh, sftp, or dspipes ssh connections to the same user@host will use a new channel on the same master session - it starts WAY faster, and even if your original session required a password, the new ones don't.

2) then you can do this in your shells (you might even want to do it in your shell profile):

Code: Select all

export COZ_SSH_OPTS="myuser@myzos"
This gives the default "-ssh options" for any todsn, fromdsn or cozclient command. After that, you can just do this:

Code: Select all

todsn //my.dataset < /etc/profile   
(you can skip specifying the "-ssh user@host")
jacobsm
Posts: 37
Joined: Thu Apr 23, 2009 9:18 am
Location: Tampa, Florida

Re: Using todsn to go directly to Sysout

Post by jacobsm »

I tried your example, but I'm not able to create an outdes environment and then have the sysout use it

#!/bin/sh
todsn -ssh aimj@tcs1 -r -x 'sysout(a) outdes(a) title(test)' //sysout < $1

todsn-client(78159)[E]: todsn(AIMJ.SYSOUT): Error opening output dataset, rc=103, msg="BPXWDYN keyword error"
todsn(AIMJ.SYSOUT)[E]: DatasetHandler: BPXWDYN allocation failed RC=-27, keyword number 7 was in error
todsn(AIMJ.SYSOUT)[E]: DatasetHandler: BPXWDYN command was: "alloc fi(SYS00002) reuse msg(2) sysout(a) outdes(a) title(test)"
todsn-client(78159)[E]: server exit_code=103
todsn-client(78159)[E]: transmitted byte counts do not match, server sent/received = 0/1, client received/sent = 0/320
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Using todsn to go directly to Sysout

Post by dovetail »

You are getting a BPXWDYN error, it is complaining about the 7th keyword - "title". That is not valid BPXWDYN keyword for "allocation".

I think I see the problem - CO:Z Supports BPXWDYN for "Requesting dynamic allocation", not for "Requesting dynamic output". So, currently there isn't a way to do a "Alloc ... outdes(xxx)" referring to a "Outdest(xxx) ...."

For more information on using BPXWDYN keywords that are valid for "Requesting dynamic allocation", see "Using REXX and z/OS Unix System Services" - CH 6: BPXWDYN.
jacobsm
Posts: 37
Joined: Thu Apr 23, 2009 9:18 am
Location: Tampa, Florida

Re: Using todsn to go directly to Sysout

Post by jacobsm »

It would be a nice enhancement though.

We're looking at several options on how to send fully composed AFP documents built on a Windows platform directly to the JES2 spool and we need metadata like title to make our process work.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Using todsn to go directly to Sysout

Post by dovetail »

I understand.

Some options:

1) submit a job from using cozsftp. The instream data would contain the binary AFP data. If the data is both binary and variable length, then it would be tricky since then the records for the entire job stream would need to be RDW-prefixed, and the leading JCL would need to be pre-EBCDIC-ified.

2) write a program or script (maybe even in REXX) on z/OS that does the outdes + calls todsn. Then, call this script from windows using "cozclient".

3) as you suggest, we could add an option to todsn to support dynamic output keywords for bpxwdyn.
riham
Posts: 1
Joined: Wed Dec 03, 2014 4:44 am

Re: Using todsn to go directly to Sysout

Post by riham »

This is a problem with our test suite. DTLBATRC is no longer shipped with the toolkit - this is a feature that is available via COZBATCH. Thanks for reporting this, we'll update our test cases.
We are the leading the world in providing best JN0-332 dump gre and Test-king.com prep solutions. Our incredible offers for nova and www.kumc.edu gedare accessible at reasonable prices; our Florida National University is very rare in IT world.
Post Reply