read: procedure options (main); /* 18 January 2012. */ declare line character (100) varying controlled; declare text character (100) varying; declare max_length fixed binary; declare in file input; on endfile (in) go to done; open file (in) title ('/readline.pli,type(text),recsize(100)'); max_length = 0; do forever; get file (in) edit (text) (L); put skip list (text); if length (text) > max_length then do; max_length = length(text); /* empty the stack */ do while (allocation(line) > 0); free line; end; allocate line; line = text; end; else if length(text) = max_length then do; allocate line; line = text; end; end; done: put skip list (max_length || ' is the length of the longest line(s)' ); do while (allocation(line) > 0); put skip list (line); free line; end; end read;