As we can issue site command in ftp mode,
after that we can submit JCL file to JES and run it,
the JCL file can be located in local folder or z/OS dataset.
A. ftp mode:
1. Submit local JCL file to JES:
start command console:WIN->run->cmd
change dir to JCL file's folder:
>cd dir
issue ftp command in command console:
>ftp ip_address
login with user name and password: user user_name password
issue site command:
>site filetype=jes
You will see:
SITE command was accepted
then issue put command to submit JCL to JES:
>put JCL_File_Name
then you can use dir to browse:
>dir
You will see:
ftp> dir
200 Port request OK.
125 List started OK
JOB_NAME JOB_Number OUTPUT X Spool Files
250 List completed successfully.
After job finished, status changed to OUTPUT,
you can use get command to get spool file to local drive:
>get Job_Number
2. Submit JCL file stored in z/OS dataset to JES:
After issue site command in ftp mode, issue get command like this:
>get 'dataset_name(member)' spool_file_name
get command will retrive spool file automaticlly when job finished,
spool_file_name is the file which will get to local folder.
You also can issue get command to retrive one of spool file:
>get JOB_Number.file_number: get J1234567.1
J1234567 is the job number, it will get the first spool file in job J1234567
3. Configuration:
after login and issue site command, issue this:
>quote site status
You will see all the settings.
B. shell script mode:
1. We can write a shell to issue all the command we needed at the same time automaticlly.
Suppose ftpjw is the shell name, we can store ip_address, user name and password in it,
for security reason, we'd better compile shell scirpt to an executable file, then nobody
can get something sensitive information like user_name and password etc.
issue this command:
>ftpjw put JCL_File_Name
it will submit the JCL_File_Name in current dir to JES.
issue this command:
>ftpjw dir
it will print out the jobs, this based on user's settings, like owner, jobname prefix.
issue this command:
>ftpjw get J1234567
it will get all JOB_Number's spool file into local folder.
issue this command:
>ftpjw get J1234567.2
it will get JOB_Number's 2nd spool file into local folder as the same name for parameter 3 of script.
Due to shell scirpt's reason, we can't submit JCL located in z/OS dataset.
Script will stop running and won't waiting job finish, we can use expect command to accomplish.