/* This xedit macro assumes you're editing the file CD413 TOC */ /* and will quit that file after reading it and create a new */ /* FILESETS ON413CD A, leaving you within xedit for that new file. */ input_file = 'CD413 TOC' output_file = 'FILESETS ON413CD A' 'EXTRACT /FNAME/FTYPE/' If strip(fname.1) strip(ftype.1) ^= input_file Then Do 'EMSG Run this xedit macro only when editing' input_file'.' Exit 123 End 'CASE M R' 'TOP' 'MACRO ALL' /* In the .toc file, a file is bracketed with curly brackets, {}, */ /* and within those curly brackets, filesets are described and */ /* bracketed with square bracktes, []. */ all_filesets='' '/{' Do while rc=0 /* Find all the files in this .toc file. */ 'EXTRACT /CURLINE/LINE/' parse var curline.3 filename . . . package . last_line = '' 'NEXT' 'EXTRACT /CURLINE/LINE/' first_char = Substr(curline.3,1,1) Do while first_char^='}' /* Find all the filesets in this file. */ If first_char = '[' Then Do /* Last line was the start of a package descriptor. */ parse var last_line fileset . . . . . description all_filesets=all_filesets fileset file.fileset = filename package.fileset = package desc.fileset = strip(description) sum.fileset = 0 'LOCATE /%/' /* Zip to start of size requirements. */ 'NEXT' 'EXTRACT /CURLINE/LINE/' first_char = Substr(curline.3,1,1) Do while first_char^='%' /* Find all the requirements for this fileset. */ Parse var curline.3 . k_needed . sum.fileset = sum.fileset + k_needed 'NEXT' 'EXTRACT /CURLINE/LINE/' first_char = Substr(curline.3,1,1) End 'LOCATE /]/' /* Zip to end of package descriptor. */ End Else last_line = curline.3 'NEXT' 'EXTRACT /CURLINE/LINE/' first_char = Substr(curline.3,1,1) End '/{' End 'COMMAND QUIT' all_filesets = strip(all_filesets) 'XEDIT' output_file '(WIDTH 222' 'RECFM V' 'LRECL *' 'TRUNC *' 'CASE M R' 'MACRO ALL' 'TOP' 'SET MSGMODE OFF' 'DELETE *' 'SET MSGMODE ON' 'INPUT Filename in' 'INPUT /cd/usr/sys/inst.images Package Name Fileset Name Size Description' 'INPUT -------------------------------- -------------------------------- ----------------------------------- ----- ------------------------------------------------------------------------' do i=1 to Words(all_filesets) fileset = Subword(all_filesets,i,1) if length(file.fileset)>32 then say 'Rick, length(file.'fileset') is' length(file.fileset)'.' if length(package.fileset)>32 then say 'Rick, length(package.'fileset') is' length(package.fileset)'.' if length(sum.fileset)>5 then say 'Rick, length(sum.'fileset') is' length(sum.fileset)'.' if length(fileset)>35 then say 'Rick, length('fileset') is' length(fileset)'.' 'INPUT' left(file.fileset,32) left(package.fileset,32) left(fileset,35) , right(sum.fileset,5) desc.fileset End 'TOP'