I think I have always used the position specification format. In a couple of 
processes I ran before, I have

xrc = BPXWUNIX("/bin/sort -bdu -k1.1,1.11 ","pl.","pls.")

xrc = BPXWUNIX("/bin/sort -bd -k1.10,1.26 -k2.1,2.8","d.","ds.")

Maybe sort is aborting with a return code (RC, retval, etc.) and no message? 

Alan

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU>
Sent: Mar 7, 2024 9:04 AM
To: <IBM-MAIN@LISTSERV.UA.EDU>
Subject: Re: What am I doing wrong with BPXWUNIX sort?

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 wrote:

>You&rsquo;re using the same stem variable for input and output. Use a specific 
>stdout. stem and see if that fixes it. Kolusu&rsquo;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

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to