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
Using todsn to go directly to Sysout
Re: Using todsn to go directly to Sysout
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:
If you are just sending a file, you could also use redirection rather than a pipe:
Then, if you want to use other BPXWDYN keywords along with sysout, you can specify them like this:
So, try this:
Code: Select all
cat $1 | todsn -ssh me@zos -x 'sysout(a)' //sysout
Code: Select all
todsn -ssh me@zos -x 'sysout(a)' //sysout < $1
Code: Select all
todsn -ssh me@zos -x 'sysout(a) outdes(foo) forms(xxyy)' //sysout < $1
Re: Using todsn to go directly to Sysout
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):
This gives the default "-ssh options" for any todsn, fromdsn or cozclient command. After that, you can just do this:
(you can skip specifying the "-ssh user@host")
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"
Code: Select all
todsn //my.dataset < /etc/profile
Re: Using todsn to go directly to Sysout
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
#!/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
Re: Using todsn to go directly to Sysout
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.
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.
Re: Using todsn to go directly to Sysout
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.
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.
Re: Using todsn to go directly to Sysout
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.
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.
Re: Using todsn to go directly to Sysout
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.