This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ----------------------------------------------------- * | |
| Small routine to put into a rexx exec invoked during | | |
| TSO Logon, or manually after, to test for a zfs being | | |
| mounted and if not then to mount it. | | |
* ----------------------------------------------------- */ | |
if listdsi("'userid.zopen.zfs'") = 4 then do | |
x = syscalls('ON') | |
path = '/u/userid/zopen/etc/' | |
address syscall , | |
'lstat (path) st.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this short shell script will allow the shell user to invoke | |
# any TSO command that resides in a load library that is not | |
# in the STEPLIB or Link List. | |
# | |
# Change the hlq.load.library to your load library and enjoy | |
# | |
# Copy into a directory in your PATH to use as a shell command | |
# and issue chmod +x xxxxx (where xxxxx is the name you gave to |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AddComma: Procedure /* Code provided by Doug Nadel back before the turn of the century */ | |
arg bignum | |
cbignum = strip(translate('0,123,456,789,abc,def,ghi,jkl,mno,pqr,stu,vwx', , | |
right(bignum,34,','), , | |
'0123456789abcdefghijklmnopqrstuvwx'),'L',',') | |
return cbignum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --------------- REXX ------------------ * | |
| SwapEQ - Swap the sides of an = setting | | |
| a = b | | |
| becomes | | |
| b = a | | |
* --------------------------------------- */ | |
Address ISREdit | |
"Macro (range) NOPROCESS" | |
"PROCESS RANGE S" | |
"(start) = linenum .zfrange" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --------------------- REXX ---------------------- * | |
| This is a sample routine using REXX to deternmine | | |
| if a file exists within OMVS. | | |
* ------------------------------------------------- */ | |
file = '~/.profile' | |
rc = exist(file) | |
if rc > 0 then say 'File exists' | |
else say 'File does not exist' | |
file = 'bad.file' | |
rc = exist(file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* rexx */ | |
/* call USS sleep routine */ | |
parse arg sleep_sec . | |
say time() | |
address 'SYSCALL' 'SLEEP ('sleep_sec')' | |
say time() | |
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ---------------------------------------------------- * | |
| Change the zus4anyc (SRCHFOR default) to selected (/) | | |
| if it is null with option Set. | | |
| Or option Reset restore it. | | |
| | | |
| Use this before and after thus: | | |
| | | |
| Address ISPExec | | |
| call check_anyc 'SET' | | |
| "LMDINIT LISTID(LISTID) LEVEL("hlq"."file_pfx"*)" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This routine will test if the active user has the | |
ability to access UID 0 (superuser) | |
*/ | |
Check_UID0: | |
address syscall 'geteuid' /* get current euid */ | |
euid = retval | |
address syscall 'seteuid 0' /* try to set uid 0 */ | |
if retval /= 0 then do | |
gooduid0 = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sample REXX code to use grep to search a z/OS sequential dataset for a string: | |
/* rexx */ | |
arg file string | |
x = searchstring(file,string) | |
if x = 0 then do | |
say 'No results found for:' string | |
exit 4 | |
end | |
do i = 1 to results.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ---------------------- REXX ----------------------------- * | |
| ISPF Edit Macro to display the requested record in hex in | | |
| an infoline. (Note: no validation is performed) | | |
| | | |
| Syntax: EHEX line | | |
| | | |
| Where EHEX is the macro name (change as you wish) | | |
| line is a record number | | |
| | | |
| Sample: EHEX 4 | |
NewerOlder