How to read and transfer a spool joblog

General discussion of the Co:Z Toolkit
Post Reply
andyz
Posts: 2
Joined: Mon Apr 27, 2015 4:46 pm

How to read and transfer a spool joblog

Post by andyz »

Hi, We are using Co:z on z/os as a sftp client.

One recent client request is, instead of a z/OS dataset, transfering some joblogs from JES2 spool directly to a remote server.

i know we can always use a job step to copy the spool joblog into a dataset and then do the transfer, Just wonder if we can save that step all with one co:z sftp client function.

Thanks

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

Re: How to read and transfer a spool joblog

Post by dovetail »

Yes you can.

From a remote client connected to the Co:Z SFTP server:
http://dovetail.com/docs/sftp/using.html#server_jes

You can also use //-JES from the cozsftp client:

cozsftp> cd //-JES/JOB112
cozsftp> lls -al # if you want to list the spool files
cozsftp> put MYSTEP.MYDD /path/to/remote/file
andyz
Posts: 2
Joined: Mon Apr 27, 2015 4:46 pm

Re: How to read and transfer a spool joblog

Post by andyz »

Yes, but this is for co:z on z/OS as a server. Our requirement is, co:z on z/OS as a client, connecting to a remote sftp server on linux. Now we can sftp put a dataset from our mainframe onto the linux system, we hope we can put a spool joblog directly.

How can we do it?

Andy

dovetail wrote:Yes you can.

From a remote client connected to the Co:Z SFTP server:
http://dovetail.com/docs/sftp/using.html#server_jes

You can also use //-JES from the cozsftp client:

cozsftp> cd //-JES/JOB112
cozsftp> lls -al # if you want to list the spool files
cozsftp> put MYSTEP.MYDD /path/to/remote/file
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: How to read and transfer a spool joblog

Post by dovetail »

From the cozsftp client:

Code: Select all

cozsftp> lcd //-JES/JOB112
cozsftp> lls -al # if you want to list the spool files
cozsftp> put MYSTEP.MYDD /path/to/remote/file
this assumes that you know the job number (e.g. JOB112).

Lets say that you wanted to have a COZBATCH/cozsftp step that sent a spool file from an earlier step in the same job.
If you are running on z/OS 2.1 or later with Co:Z 2.4.3 or later, then you can do this:

Code: Select all

...
// EXEC PGM=COZBATCH
//STDIN DD *
# under z/OS 2.1 or later and COZBATCH 2.4.3 or later, 
# JES symbols are exported as environment variables.
# the first 8 chars of the job correlator is the job number (Jnnn/Tnnn/Snnn)
jobnum=$(echo $JES_SYS_CORR_CURRJOB | head -c8)

cozsftp ... <<EOB
lcd //-JES/$jobnum
put MYSTEP.MYDD /path/to/remote/file
EOB
/*
atrivino
Posts: 17
Joined: Wed Jul 13, 2011 9:28 am

Re: How to read and transfer a spool joblog

Post by atrivino »

Support Team,

We have a similar question in regards of the usage of the JES spool access from SFTP. Currently we have racf profile (SFTP.JES) that has a UACC of NONE for all users. If a user wants to gain access to just perform an LS to see what is out there in the queue, how granular could we make this profile to restrict them from accessing visibility to all jobs?

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

Re: How to read and transfer a spool joblog

Post by dovetail »

Co:Z SFTP uses the following non-authorized interfaces for JES jobs access:

- Extended Status (SSI 80)
- JES Spool Browse

These interfaces are protected in the same way that they are for the TSO OUTPUT and STATUS commands, and for SDSF (IF you are using SAF/RACF to control SDSF security)

Since your organization has a support agreement, please open a ticket if you would like to discuss specifics with respect to your company's set up.
Post Reply