File size distribution: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: made the output more consistant looking, added whitespace to the output, used a more idiomatic programming style..) |
m (→{{header|REXX}}: made some cosmetic changes for statement alignment.) |
||
Line 421: | Line 421: | ||
parse var fID fn '.' /* " just the pure filename of pgm.*/ |
parse var fID fn '.' /* " just the pure filename of pgm.*/ |
||
sw=max(79, linesize() - 1) /* " terminal width (linesize) - 1.*/ |
sw=max(79, linesize() - 1) /* " terminal width (linesize) - 1.*/ |
||
work= fn".OUT" /*filename for workfile output of DIR.*/ |
|||
'DIR' ds '/s /-c /a-d >' |
'DIR' ds '/s /-c /a-d >' work /*do (DOS) DIR cmd for a data structure*/ |
||
call linein 0, 1 /*open output file, point to 1st record*/ |
call linein 0, 1 /*open output file, point to 1st record*/ |
||
maxL=0; @.=00; g=0 /*max len size; log array; # good recs.*/ |
maxL=0; @.=00; g=0 /*max len size; log array; # good recs.*/ |
||
$=0 /*$: total bytes used by files found. */ |
$=0 /*$: total bytes used by files found. */ |
||
do |
do while lines(work)\==0; _=linein(work) /*process the data in the DIR work file*/ |
||
if left(_, 1)==' ' then iterate /*Is the record not legitimate? Skip. */ |
|||
parse upper var _ . . sz . /*uppercase suffix*/ |
parse upper var _ . . sz . /*uppercase suffix*/ |
||
if \datatype(sz,'W') then do; #=left(sz, length(sz) - 1) /*SZ has a suffix?*/ |
if \datatype(sz,'W') then do; #=left(sz, length(sz) - 1) /*SZ has a suffix?*/ |