Thanks all. The mystery deepens. Using the same stem variable should not be the problem. I have done that before successfully, and the sort command documentation talks about how it uses a temporary file to avoid clobbering the input data if the files are the same.
BUT ... changing to a different stem variable revealed that sort is not populating my output file at all. The new stem variable was uninitialized after the sort! THAT is why Index. is unchanged -- sort is not writing to my output file/stem at all! So that leaves the question: why is sort not populating my output stem? I know sort is available and actually running because in one test I fat-fingered the -k2 and got three messages in stderr. Why would sort not populate the output stem? Charles On Thu, 7 Mar 2024 10:15:10 +0800, David Crayford <dcrayf...@gmail.com> wrote: >You’re using the same stem variable for input and output. Use a specific >stdout. stem and see if that fixes it. Kolusu’s snippet works for me. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN