File size distribution: Difference between revisions

m
→‎{{header|REXX}}: added/changed some comments, added boilerplate to suppress some superfluous errors.
(→‎{{header|REXX}}: added support for an alternative comma, added a programming note (before the output section).)
m (→‎{{header|REXX}}: added/changed some comments, added boilerplate to suppress some superfluous errors.)
Line 422:
sw=linesize() - 1; if sw<80 then sw=79 /* " terminal width (linesize) - 1.*/
dirOut= fn".OUT" /*construct filename for output of DIR.*/
'DIR' ds '/s /a-d >' diroutdirOut /*execute thedo (DOS) DIR commandcmd for DS.a data structure*/
call linein 0, 1 /*open output file, point to 1st record*/
maxL=0 /*maximum length of number of records. */
Line 442:
maxL=max(L, maxL) /*obtain the maximum length of filesize*/
@.L=@.L + 1 /*bump counter of category of rec size.*/
end /*j*/ /* [↑] categories: split by log ten.*/
end /*j*/
 
if g==0 then do; say 'file not found: ' ds; exit 13; end
Line 462:
end /*y*/
say
trace off; 'ERASE' dirOut /*perform clean─up (erase a work file).*/
say commas(g) ' files detected,' commas($) " total bytes."
exit /*stick a fork in it, we're all done. */