7 From:	SMTP%"prand@paul.spu.edu" 19-MAY-1993 16:04:36.62  To:	EVERHART CC:	@ Subj:	Re: Q: Files and logical names used in DCL OPEN statements  + Date: Wed, 19 May 1993 10:23:45 -0700 (PDT) $ From: Phil Rand <prand@paul.spu.edu>& Sender: Phil Rand <prand@paul.spu.edu>( Reply-To: Phil Rand <prand@paul.spu.edu>C Subject: Re: Q: Files and logical names used in DCL OPEN statements  To: INFO-VAX <INFO-VAX@sri.com> 
 In-Reply-To:  > Message-Id: <Pine.3.07.9305191044.C28868-c100000@paul.spu.edu> Mime-Version: 1.0 * Content-Type: TEXT/PLAIN; CHARSET=US-ASCII   Here's another cool trick:    F Use a DCL OPEN statement to open a file, assigning a logical, say FOO,G then use the /OUTPUT=FOO modifier on another DCL verb to send output to F the same file, maybe many times.  When you finish, close the file, andF you'll find the output from all the DCL verbs, nicely appended to each other in your file.   J Below is an example of a quick and dirty utility I wrote to produce a listJ of all CMS elements having one or more generations in any class matching a* (probably wild-card) class specification.   I I know my example works with the CMS verb, and I think I tried one or two H other DCL verbs, like maybe SHOW SYSTEM, or SHOW USERS, but I don't knowH just how general this technique is.  Oh by the way, I did this under VMS 5.5-2, and CMS 3.5-5.   I I'd be interested in hearing about whether this is supported, and whether 1 you would consider it good DCL programming style.    --Phil  A // Phil Rand                                   prand@paul.spu.edu A // Computer & Information Systems                  (206) 281-2428 A // Seattle Pacific University, 3307 3rd Ave W, Seattle, WA  98119   P $!============================================================================== $! SUSPECTS.COM  $!E $!	Procedure to automatically produce a first-cut list of Banner CMS  0 $!	elements which may have been modified at SPU. $!D $!	Parameter:  p1 = class specification to list.  Defaults to "lco*"? $!		    to list all files which have been envolved in any local  $!		    change order.  $!P $!============================================================================== $  $   class_spec = p1  $  $   if class_spec .eqs. "" $   then $	class_spec = "lco*" 	 $   endif  $ D $   element_list := sys$scratch:element-list-'f$getjpi(0,"pid")'.tmp@ $   class_list := sys$scratch:class-list-'f$getjpi(0,"pid")'.tmp! $   cms set library banner_cmslib # $   open/write elist 'element_list' 3 $   cms show class 'class_spec'/output='class_list'   $   open/read clist 'class_list' $   !counter = 0
 $ class_loop: , $	read/end_of_file=end_class_loop clist line> $	if (f$extract(0,3,line) .eqs. "LCO") !.and. (counter .lt. 3) $	then( $	    class_name = f$element(0," ",line)A $	    write sys$output "Listing contents of class ''class_name'." 8 $	    cms show class/contents 'class_name' /output=elist $	    !counter = counter + 1 $	endif  $	goto class_loop  $ end_class_loop:  $   close clist  $   close elist  $ $ $   open /read elist 'element_list' % $   open /write suspects suspects.lis  $ elements_loop:0 $	read /end_of_file=end_elements_loop elist line' $	line = f$edit(line,"compress,upcase")  $	!show sym line $	if line .nes. "" $	then0 $	    if f$extract(0,10,line) .nes. "CLASSES IN"
 $	    then' $		element_name = f$element(1," ",line) $ $		if f$parse(element_name) .nes. "" $		then " $		    write suspects element_name $		endif $	    endif  $	endif  $	goto elements_loop $ end_elements_loop: $   close elist  $   close suspects $ ( $   sort/nodup suspects.lis suspects.lis' $   write sys$output "----Suspects----"  $   type suspects.lis  $   write sys$output "" , $   write sys$output "Saved in suspects.lis" $   write sys$output ""  $ 	 $ wrapup: ! $   delete/nolog 'element_list';*  $   delete/nolog 'class_list';*  $   exit            