Need help; New to Perl

R

rault

I'm a mainframe programmer looking for help with Perl.

I need the logic/code to scan existing JCL scripts and extract only the
JCL STEPs that generate reports, especially those using the Xerox DJDE
format.

In other words, I'm looking for a script and/or the logic necessary to
scan JCL text files, extract only the step(s) that print a report and
rebuild a JCL script to print said report(s).

* I have figured out the the steps I'm looking for should contain one
or
more of the following strings:

"PGM=PAJZDJDE"
"SYSOUT=1"
"SYSOUT=2"
"SYSOUT=3"
"SYSOUT=4"
"SYSOUT=5"
"SYSOUT=6"
"SYSOUT=7"
"SYSOUT=8"
"SYSOUT=9"
"UAPB.OPTICAL"

* Also, the script should convert "SYSOUT=[1-9]" above to "SYSOUT=O"
(letter O).

Any pointers or code samples would be greatly appreciated.
 
A

Anno Siegel

I'm a mainframe programmer looking for help with Perl.

I need the logic/code to scan existing JCL scripts and extract only the
JCL STEPs that generate reports, especially those using the Xerox DJDE
format.

In other words, I'm looking for a script and/or the logic necessary to
scan JCL text files, extract only the step(s) that print a report and
rebuild a JCL script to print said report(s).

* I have figured out the the steps I'm looking for should contain one
or
more of the following strings:

"PGM=PAJZDJDE"
"SYSOUT=1"
"SYSOUT=2"
"SYSOUT=3"
"SYSOUT=4"
"SYSOUT=5"
"SYSOUT=6"
"SYSOUT=7"
"SYSOUT=8"
"SYSOUT=9"
"UAPB.OPTICAL"

* Also, the script should convert "SYSOUT=[1-9]" above to "SYSOUT=O"
(letter O).

So? Check for the first and last strings with a regex. Try a substitution
on the other ones. If any of these succeed, print the line.

What have you tried? How isn't it doing what it should?

Anno
 
H

Henry Law

I'm a mainframe programmer looking for help with Perl.

Be careful that you're not a mainframe programmer looking for someone
to write Perl for her/him, gratis. In a group where many of the
regulars write Perl for a living that doesn't go down too well.
In other words, I'm looking for a script and/or the logic necessary to
scan JCL text files, extract only the step(s) that print a report and
rebuild a JCL script to print said report(s).

I expect you Googled, but just in case not I did so on your behalf; no
useful results so I think we can assume there are no existing
utilities. Did you check CPAN? Well I did that too - nothing much
there either, which isn't really a surprise given it's mainframe JCL.
* I have figured out the the steps I'm looking for should contain one
or
more of the following strings:

"PGM=PAJZDJDE"
"SYSOUT=1" ....
"UAPB.OPTICAL"

* Also, the script should convert "SYSOUT=[1-9]" above to "SYSOUT=O"
(letter O).

I'm not sure you've characterised your problem properly. The JCL
steps are probably coded across multiple lines and if I understand you
properly you want to extract the complete step. What about backward
references and temporary files and //SYSIN DD * and all that? I'm
sure it's not just a matter of matching the strings above (which would
be easy in Perl).

You really will have to have a bash at writing the Perl program
yourself to get any help. When it croaks (as it will) post a small
workable subset here, together with a __DATA__ section containing
sample JCL, and people will gladly help you. What they won't do is
help you with writing the program from scratch.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,170
Messages
2,570,925
Members
47,466
Latest member
DrusillaYa

Latest Threads

Top