Re: bpxwunix

2024-03-07 Thread Bob Bridges
I've a REXX subroutine that uses DFSORT (or is it SYNCSORT?) to sort the
stack, but this is easier.  But it's gonna work only if I have at least a
UID and GID, right?

---
Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313

/* It is always the right time to do the right thing.  -Martin Luther King,
Jr. */

-Original Message-
From: IBM Mainframe Discussion List  On Behalf Of
Steve Beaver
Sent: Thursday, March 7, 2024 13:36

/* REXX */
stdin.0=5
stdin.1="KIJJ" 
stdin.2="KQWR" 
stdin.3="ADGF" 
stdin.4="OEPE" 
stdin.5="VNVV" 

cmd="sort" 

call bpxwunix cmd,stdin.,stdout.,stderr.

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


Re: BPXWUNIX Improvements

2019-11-09 Thread Paul Gilmartin
On Sat, 9 Nov 2019 14:13:31 +0800, David Crayford  wrote:
>...
>> If that's the UNIX/shell command "env", use some caution because its
>> output may not have metacharacters in variable values properly quoted.
>> "export -p" does better.
>
>Do you have an example of "env" with the meta-characters issue?
>
>Maybe "printenv" would be better as it only has one purpose. The trouble
>with "export -p" is that the output needs to be parsed and reformatted
>before it can be used in a environment variable stem.
>
Consider:
( set -x; export wombat="foobar
xyzzy=barfoo"; env; export -p; printenv ) | grep foo

wombat=foobar
xyzzy=barfoo

export wombat="foobar
xyzzy=barfoo"

wombat=foobar
xyzzy=barfoo

... none of them produces Rexx-friendly output, and only "export -p"
produces sh-friendly.

Yes, I'm wearing my Black Team cloak.

-- gil

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


Re: BPXWUNIX Improvements

2019-11-08 Thread David Crayford

On 2019-11-09 10:21 AM, Paul Gilmartin wrote:

On Fri, 8 Nov 2019 21:04:28 +0800, David Crayford wrote:

Lionel came up with the best solution which was to run "env" and then to
use the result stem for all the other bpxwunix() calls! Great tip!


If that's the UNIX/shell command "env", use some caution because its
output may not have metacharacters in variable values properly quoted.
"export -p" does better.


Do you have an example of "env" with the meta-characters issue?

Maybe "printenv" would be better as it only has one purpose. The trouble 
with "export -p" is that the output needs to be parsed and reformatted

before it can be used in a environment variable stem.



-- gil

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


Re: BPXWUNIX Improvements

2019-11-08 Thread Paul Gilmartin
On Fri, 8 Nov 2019 21:04:28 +0800, David Crayford wrote:
>
>Lionel came up with the best solution which was to run "env" and then to
>use the result stem for all the other bpxwunix() calls! Great tip!
> 
If that's the UNIX/shell command "env", use some caution because its
output may not have metacharacters in variable values properly quoted.
"export -p" does better.

-- gil

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


Re: BPXWUNIX Improvements

2019-11-08 Thread David Crayford

Thanks Lionel!

Lionel came up with the best solution which was to run "env" and then to 
use the result stem for all the other bpxwunix() calls! Great tip!


On 2019-11-08 8:27 PM, Lionel B Dyck wrote:

I want to thank  David Crayford - your suggestions on the bpxwunix
environment variables to speed up git was the right direction.  The calls
when from 10-15 seconds (we have a slow lpar) to 1-3 seconds.

  

  


Lionel B. Dyck <
Website:   http://www.lbdsoftware.com

"Worry more about your character than your reputation.  Character is what
you are, reputation merely what others think you are." - John Wooden

  



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


Re: BPXWUNIX and BPXBATCH (was: Java on z/OS?)

2017-06-10 Thread Mark Zelden
On Sat, 10 Jun 2017 20:47:50 -0500, Paul Gilmartin  wrote:

>On Sat, 10 Jun 2017 19:43:18 -0500, Mark Zelden wrote:
>>
>>No, what I meant was you can direct those DDs to a standard MVS file as 
>>opposed to only a unix file  ...
>>
>I'm not sure what meaning "standard" conveys.  Would it be
>better to say "modal"?

I don't even know why I'm responding to such pedantry when I'm sure 100% of
everyone that reads this list knows exactly what I meant, but maybe you would
prefer the term "classic" or "legacy".  I don't think I've ever heard someone 
call the
original MVS data set a "modal data set".  

Best regards,

Mark
--
Mark Zelden - Zelden Consulting Services - z/OS, OS/390 and MVS
ITIL v3 Foundation Certified
mailto:m...@mzelden.com
Mark's MVS Utilities: http://www.mzelden.com/mvsutil.html

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


Re: BPXWUNIX and sort

2015-11-06 Thread Paul Gilmartin
On Fri, 6 Nov 2015 06:10:57 -0600, Bill Godfrey wrote:
>
>Try setting LC_COLLATE=S370 or SAA
> 
Looks good experimenting from shell command line:

user@OS/390.24.00: locale
LANG=C
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_SYNTAX="C"
LC_TOD="C"
LC_ALL=
user@OS/390.24.00: echo "B^J2^Jb^JA^J1^Ja" | sort  
1
2
A
B
a
b
user@OS/390.24.00: echo "B^J2^Jb^JA^J1^Ja" | LC_ALL=S370 sort  
a
b
A
B
1
2
user@OS/390.24.00: 

(Use "locale -a" to display available locale settings.)

But:

user@OS/390.24.00: echo "B^J2^Jb^JA^J1^Ja" | LC_ALL=en_US sort 
1
2
A
B
a
b
user@OS/390.24.00: echo "B^J2^Jb^JA^J1^Ja" | LC_ALL=en_CA sort 
1
2
a
A
b
B
user@OS/390.24.00: 

... Why is the result for en_US so radically different from en_CA?  I believe
the en_US is wrong.

-- gil

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


Re: BPXWUNIX and sort

2015-11-06 Thread John P. Baker
Bill,

Including" LC_COLLATE=S370" resolved the problem.

Thanks for your insight.

John P. Baker

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Bill Godfrey
Sent: Friday, November 6, 2015 7:11 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: BPXWUNIX and sort

On Thu, 5 Nov 2015 23:13:34 -0500, John P. Baker wrote:

>Kirk,
>
>The following example illustrates what I am trying to do --
>
>Call BPXWUNIX "sort -k 3 -k 4 -k 1 -k 2", table_in., table_out., 
>messages_out. ;
>
>In the above example, "table_in." in a stem variable containing the rows to be 
>sorted, "table_out." Is a stem variable into which the sorted rows are to be 
>written, and "messages_out." Is a stem variable into which any error messages 
>are to be written.
>
>The "-k n" parameters indicates the space/tab delimited fields which are to be 
>used as sort keys.
>
>The problem that I am experiencing is that the data is being sorted using the 
>ASCII collating sequence (i.e., numerics precede alphabetics).
>
>Which I get the table back, "B12" precedes "BBB".
>
>This makes the subsequent binary search subroutine fail since as far as it is 
>concerned, the rows contained in stem variable "table_out." are not sorted.
>
>There is an optional fifth parameter (another stem variable) which allows 
>environmental variable settings to be passed.
>
>I tried setting LC_COLLATE to no effect.
>
>Any recommendations will be most welcome.
>

Try setting LC_COLLATE=S370 or SAA

env.0=1
env.1='LC_COLLATE=S370'
Call BPXWUNIX "sort -k 3 -k 4 -k 1 -k 2", table_in., table_out., 
messages_out.,env.;

Bill

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


Re: BPXWUNIX and sort

2015-11-06 Thread Bill Godfrey
On Thu, 5 Nov 2015 23:13:34 -0500, John P. Baker wrote:

>Kirk,
>
>The following example illustrates what I am trying to do --
>
>Call BPXWUNIX "sort -k 3 -k 4 -k 1 -k 2", table_in., table_out., messages_out. 
>;
>
>In the above example, "table_in." in a stem variable containing the rows to be 
>sorted, "table_out." Is a stem variable into which the sorted rows are to be 
>written, and "messages_out." Is a stem variable into which any error messages 
>are to be written.
>
>The "-k n" parameters indicates the space/tab delimited fields which are to be 
>used as sort keys.
>
>The problem that I am experiencing is that the data is being sorted using the 
>ASCII collating sequence (i.e., numerics precede alphabetics).
>
>Which I get the table back, "B12" precedes "BBB".
>
>This makes the subsequent binary search subroutine fail since as far as it is 
>concerned, the rows contained in stem variable "table_out." are not sorted.
>
>There is an optional fifth parameter (another stem variable) which allows 
>environmental variable settings to be passed.
>
>I tried setting LC_COLLATE to no effect.
>
>Any recommendations will be most welcome.
>

Try setting LC_COLLATE=S370 or SAA

env.0=1
env.1='LC_COLLATE=S370'
Call BPXWUNIX "sort -k 3 -k 4 -k 1 -k 2", table_in., table_out., 
messages_out.,env.;

Bill

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


AW: Re: BPXWUNIX and sort

2015-11-06 Thread Peter Hunkeler
>The problem that I am experiencing is that the data is being sorted using the 
>ASCII collating sequence (i.e., numerics precede alphabetics).


I understand the UNIX sort shell command always sorts according to the 
*collating sequence* defined in the current locale. Is't not ASCII and it's not 
EBCDIC, it's not a sort in the binary content of the bytes.


I had not looked into this in detail before but it seems that the C-locale (the 
default) defines that digits collate before upper case and upper case before 
lower case. Other locales do otherwise, e.g. De_CH seems to define digits 
collate before letters, and lower case and upper case letters collate equally, 
i.e. ther is no diference between 'a' and 'A'.


You should be able to see the difference is you add a stem containing one 
variable "LC_COLLATE=..." to your bpxwunix call.


Now with all this said, I can't come up with a solution to your problem, namely 
sorting the stem in strict binary sequence.


--


ßph

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


Re: BPXWUNIX and sort

2015-11-05 Thread John P. Baker
Kirk,

The following example illustrates what I am trying to do --

Call BPXWUNIX "sort -k 3 -k 4 -k 1 -k 2", table_in., table_out., messages_out. ;

In the above example, "table_in." in a stem variable containing the rows to be 
sorted, "table_out." Is a stem variable into which the sorted rows are to be 
written, and "messages_out." Is a stem variable into which any error messages 
are to be written.

The "-k n" parameters indicates the space/tab delimited fields which are to be 
used as sort keys.

The problem that I am experiencing is that the data is being sorted using the 
ASCII collating sequence (i.e., numerics precede alphabetics).

Which I get the table back, "B12" precedes "BBB".

This makes the subsequent binary search subroutine fail since as far as it is 
concerned, the rows contained in stem variable "table_out." are not sorted.

There is an optional fifth parameter (another stem variable) which allows 
environmental variable settings to be passed.

I tried setting LC_COLLATE to no effect.

Any recommendations will be most welcome.

John P. Baker

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Kirk Wolf
Sent: Thursday, November 5, 2015 10:40 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: BPXWUNIX and sort

Have you looked at "man sort" for an explanation of the options that control 
ordering of keys?

Can you provide an isolated example of the sort command, its options and some 
data to illustrate your problem?

For example:

zos> sort   - <http://dovetail.com

On Thu, Nov 5, 2015 at 7:49 PM, John P. Baker  wrote:

> I am using the BPXWUNIX service from a TSO/E REXX procedure to invoke 
> the OMVS sort command to sort a REXX stem variable.
>
> The sort works fine except that it uses the ASCII collating sequence 
> as opposed to the EBCDIC collating sequence.
>
> This makes the output stem variable unsuitable for use by a binary 
> search algorithm.
>
> Can anyone provide an example of how to make the sort command utilize 
> the EBCDIC collating sequence?
>
> John P. Baker
>
> --
> 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

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


Re: BPXWUNIX and sort

2015-11-05 Thread Kirk Wolf
Have you looked at "man sort" for an explanation of the options that
control ordering of keys?

Can you provide an isolated example of the sort command, its options and
some data to illustrate your problem?

For example:

zos> sort   -  I am using the BPXWUNIX service from a TSO/E REXX procedure to invoke the
> OMVS sort command to sort a REXX stem variable.
>
>
>
> The sort works fine except that it uses the ASCII collating sequence as
> opposed to the EBCDIC collating sequence.
>
>
>
> This makes the output stem variable unsuitable for use by a binary search
> algorithm.
>
>
>
> Can anyone provide an example of how to make the sort command utilize the
> EBCDIC collating sequence?
>
>
>
> John P. Baker
>
>
> --
> 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