In order to work with JCL scripts from MVS, they must first be
converted into simple ASCII (or ISO 8859-1) text files with
no special formatting in them. That means no packing, no
formating control characters (except linefeeds), and no line numbers.
The PKZIP
program is normally capable of doing this
conversion (if it is told to do so ***?). When PKZIP
ping a
directory of text files, specify the -TEXT (***?) option and the
conversion will be done. FTP the zipped archive from MVS to Unix (do
not forget to set the transfer type to binary), and unpack with
unzip(1)
.
Verify that there is no strange formatting in the script files. Use
cat(1)
or more(1)
to quickly dump the file to the
terminal. Use xedit(1)
to see if there are any strange
embedded characters (like extra carriage returns, often symbolised
with "^M").
If there is any strangeness, you might be able to fix it by passing
the scripts through the trimspace
filter that was written for
this job. To get rid of strangeness, type:
$ trimspace filename
The JCL script file should be perfect now.
jcl2perl
translator
Invoke jcl2perl
on each JCL file, like so:
$ jcl2perl BULAJOUR
The translator might print some error messages, warnings, or notes.
If you find the messages annoying and you are already certain that the
translation will be correct, simply divert standard error output to
the "bit bucket" /dev/null
like so:
$ jcl2perl BULAJOUR 2>/dev/null
A file with the same name as the input file except with a .pl
suffix added to it will be created. This new file (in the above
example BULAJOUR.pl
) is an executable Perl script. To run
it, simple type it's name:
$ BULAJOUR.pl
...and it should run.
If there is ever a need to change job parameters, there are two ways that one can do it. If you are more comfortable with JCL, you can just change the JCL file and run the translator on it again. If you like Perl, you can change the script that was generated by the translator.
If the job was originally a job to run SAS and you like SAS, you might
consider doing everything in SAS. All of the SAS
OPTION
s can be set from within SAS programs, for example, and
do not need to be specified on the command line.