OK, likely nobody else is anywhere near as weird as I. But I really don't
care for the output from the SMP/E UNLOAD DDDEF command. It is difficult to
easily find things because a single logical DDDEF is spread across multiple
lines. So I wrote the little Perl program below. The only "minus" is the
fact that you must put the output from the DDDEF into a UNIX file, not a
sequential file. Basically, it puts every logical statement on a single
physical line and squeezes all multiples spaces not in ticks into a single
space. I don't claim this is the best possible. And, in fact, I actually do
most of this type of work on my Linux desktop instead of z/OS itself. That
way, I save CPU cycles, which saves money, which puts a smile on
managements' face. (we are also in the cost-cutting mode - we just released
about 1/4 of our IT staff as well as people in other departments.)
 
#!/usr/bin/perl
use strict;
use warnings;
my ($file, @file,$char,$parens,$ticks,$pchar);
while(<>) {
        chomp;
        $file.=unpack('a72',$_);
}
@file=split(//,$file);
$parens=0;
$ticks=0;
$file='';
$pchar='x';
foreach $char (@file) {
        $ticks=1-$ticks if $char eq "'";
        if ($ticks == 1) {
                $file.=$char;
                next;
        }
        $parens+=1 if $char eq '(';
        $parens-=1 if $char eq ')';
        die 'Unbalanced parentheses' if $parens < 0;
        if ($parens == 0 &&amp; $char eq '.') {
                $file.='.';
                $char="\n";
        }
        $file.=$char unless $char eq ' ' &&amp; $pchar eq ' ';
        $pchar=$char;
}
print $file;


--
John

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to