Bytes in a 3390 track - reason for the question

2022-11-24 Thread John Gateley
The reason for asking the question about bytes on a track is that I am writing 
programs to report on all disk datasets.
The first program looks at all on-line disk packs and extracts all format 1, 3, 
8 and 9 DSCBs while also providing a summary of space available/used on each 
disk (similar to VTOC on CBT file 112).
The second program produces information for all datasets. If the secondary 
allocation is in blocks then that means the primary was also and I want to 
output the allocation like this BLK(00060,00020).
To do this I subtract the block size from 56664 repeatedly until the remainder 
is less than the block size which gives me the number of blocks in a track, 
multiply this by the primary allocation in tracks should give me the figure I 
want.
Except it doesn't.

For the format 1 DSCB below ISPF 3;4 reports BLK(00060,00020) and my program 
BLK(00072,00020).
With a blocksize of 3120 there are 18 blocks per track and 4 tracks are in use. 
3 of them must be full so that gives 54 blocks meaning there are only 6 on the 
final track.

The dataset is not extended format, PDSE, HFS or VSAM so I think I need to look 
at DS1TRBAL, I subtracted 32266 from 56664 and worked out how many blocks would 
fit, I get 7 not 6.

Alternatively, if I use 55996 I get 17 blocks per track meaning there are 9 on 
the last track and I get 7.

I'm obviously missing something, and I am hoping someone can tell me what?

DS1DSNAM  DSN1.SRCLIB.DATA
DS1FMTID  1   
DS1DSSN   DB2C06  
DS1VOLSQ  0001
DS1CREDT  78003A  
DS1EXPDT  00  
DS1NOEPV  01  
DS1NOBDB  00  
DS1FLAG1  00  
DS1SYSCD  IBMOSVS2
DS1REFD   7A0148  
DS1SMSFG  80  
DS1SCXTF  80  
DS1SCXTV  0FA04000
DS1DSORG  0200
DS1RECFM  90  
DS1OPTCD  00  
DS1BLKL   0C30
DS1LRECL  0050
DS1KEYL   00  
DS1RKP
DS1DSIND  80  
DS1SCAL1  50  
DS1SCAL3  14  
DS1LSTAR  15  
DS1TRBAL  7E0A32266
DS1TTTHI  00  
DS1EXT1   010C000B000C000E
DS1EXT2   
DS1EXT3   
DS1PTRDS  00  

Data Set Name . . . . : DSN1.SRCLIB.DATA   
   
General Data  Current Allocation   
 Management class . . :Allocated blocks  . : 60
 Storage class  . . . :Allocated extents . : 1 
  Volume serial . . . : DB2C06 Maximum dir. blocks : 20
  Device type . . . . : 3390   
 Data class . . . . . :
  Organization  . . . : POCurrent Utilization  
  Record format . . . : FB Used blocks . . . . : 7 
  Record length . . . : 80 Used extents  . . . : 1 
  Block size  . . . . : 3120   Used dir. blocks  . : 1 
  1st extent blocks . : 60 Number of members . : 0 
  Secondary blocks  . : 20 
  Data set name type  : PDS   Dates
  Data set encryption : NO Creation date . . . : 2020/02/27
   Referenced date . . : 2022/11/24
   Expiration date . . : ***None***

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


Re: Bytes in a 3390 track

2022-11-23 Thread John Gateley
Thank you very much for that comprehensive explanation.

John

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


Re: Bytes in a 3390 track

2022-11-23 Thread John Gateley
Thanks Steve.

I did not know about the standard record 0, now that I do it makes sense.

John

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


Bytes in a 3390 track

2022-11-23 Thread John Gateley
Hello

On all the disk volumes I have looked at, the format 4 DSCB field DS4DEVTK 
(device track length) has the value 58786.
All the IBM documentation says that there are 56664 bytes in a track on a 3390 
drive.
At this link https://www.lascon.co.uk/hwd-3390-disks.php reference is made to 
55996 usable bytes out of 56664 per track.

Is there some 'magic' formula that converts the value in DS4DEVTK to either 
56664 or 55996, or should I just ignore DS4DEVTK?

Thanks
John

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


Re: Query ESM from REXX

2020-08-06 Thread John Gateley
Hi

CBT file 953 has TRYAUTH a REXX program and CHKAUTH a REXX function written in 
Assembler.

TRYAUTH calls CHKAUTH with a dataset name and CHKAUTH uses RACROUTE to check 
the access of the ID running the program.

For your purposes you would need to change TRYAUTH to pass a facility name and 
remove the code in CHKAUTH where LOCATE is used to get the VOLSER and the 
subsequent check for MIGRAT, also change the CLASS in the RACROUTE macro.

I hope you find this useful.

John

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


Re: Rexx parse using period as placeholder

2020-02-26 Thread John Gateley
Regarding PCRE2-Perl-Compatible Regular Expressions.

Version 10.33 for z/OS is available on file 939 and includes a much improved 
Rexx interface.

http://www.cbttape.org/ftp/cbt/CBT939.zip

Files 882 and 884 are no longer supported and have been removed from the CBT 
website.


John

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


How can a batch REXX get the step return codes for the job it is running in

2019-11-18 Thread John Gateley
This subject comes up every now and then, and I have just found a way that is 
new to me.

Since z/OS 2.2, SDSF has a new line command JS on the DA, H, I, O and ST panels 
which displays a sub panel which shows the return code and other details for 
all the steps taken from the SMF-30 sub type 4 records.

in batch REXX issue
Address SDSF "ISFEXEC DA"
loop until you are against the job you are running in and issue
Address SDSF "ISFACT DA TOKEN('"TOKEN.ix"') PARM(NP JS)"
loop on isfrows2 and output the details.

John

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


BALR and BAL in AMODE=24

2019-01-22 Thread John Gateley
Hello.

The link information in the 24-bit addressing mode consists of the 
instruction-length code (ILC), the condition code (CC), the program-mask bits, 
and the rightmost 24 bits of the updated instruction address.

I have never given much thought to the high byte when using this instruction 
and switched to BASR and BAS years ago.

Just for personal interest, does anyone recall a program using the contents of 
the link register other than as a return address?

Thanks for any replies.
John

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


Re: Need help with ISPF Dialogue Manager and VGET

2018-07-30 Thread John Gateley
Hi

This is what I have for an assembler program calling REXX, but the REXX can see 
the variables so something similar should work for you.

  CALL  ISPLINK,(VDEFINE,NXXPROG,INVXPROG,CHAR,LXXPROG),VL  
  CALL  ISPLINK,(VPUT,NXXPROG),VL 
  CALL  ISPLINK,(SELECT,LPREXX,PREXX),VL  

VDEFINE  DCCL8'VDEFINE'  
VPUT DCCL8'VPUT' 
SELECT   DCCL8'SELECT'   
NXXPROG  DCCL10'(INVXPROG)'  
INVXPROG DCCL8' '
CHAR DCCL8'CHAR '
LXXPROG  DCF'10' 
LPREXX   DCF'13' 
PREXXDCC'CMD(INVSHLST)'  

Hope this helps
John

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


Re: DASD Utilization Trigger

2018-07-29 Thread John Gateley
Hi

I have an assembler program which looks at all on-line DASD using UCBSCAN and 
prints volume name, total space, used space, free space and percentage free. I 
have been meaning to put this on the CBT for some time.
If you would like a copy then contact me off list.

Regards
John

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


Re: AC(1)

2018-05-02 Thread John Gateley
Peter,

The CBT program uses code from Mark Zelden's IPLINFO to get a list of APF 
libraries (he is credited).
In assembler this is
 L R1,16 point to CVT   
 L R1,140(,R1)   point to CVTECVT   
 L R1,228(,R1)   point to CSV table 
 L R1,12(,R1)point to APFA  
 L R4,8(,R1) point to first name
 L R5,12(,R1)point to last name 

it outputs all dataset names and volumes in this list to SYSOUT

then it does RDJFCB on STEPLIB and uses ARAJFCB to get dataset name and volume 
for all concatenated datasets. It outputs the dataset name and volume and flags 
any that are not in the APF list.

this is repeated for JOBLIB

Would the dataset being SMS-managed, or not, affect this?

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


Re: AC(1)

2018-05-01 Thread John Gateley
Hi Charles

File 953 on the CBT contains a program LISTAPF which checks every load library 
in the STEPLIB or JOBLIB against the APF list.

Regards
John

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


Re: Mass submit jcl

2018-04-21 Thread John Gateley
Dan

Great idea, this seems to do the job but may need a bit more work.

/*REXX*/
/* */
/*  The purpose of this is to enable every member of a PDS */
/*  so be submitted in order.  */
/*  Run it like this   */
/*  TSO EXEC 'MY.EXEC(SUBNEXT)' 'TEST.JCL :'   */
/* */
/*  The : means start at the first member, specify the actual  */
/*  member name to start at the member after that  */
/*  TSO EXEC 'MY.EXEC(SUBNEXT)' 'TEST.JCL MEMBER01'*/
/*  will submit MEMBER02.  */
/* */
/*  To start using a batch job just use the JCL queued below.  */
/* */
/*  It reads in a JCL member adds a return code check as the   */
/*  last step and then submits it. */
/*  When it runs at the end of the submitted job it MAY then   */
/*  submit the next job automatically. */
/* */

  ARG  pds_name mem_name
  if pds_name = '' then pull pds_name
  if mem_name = '' then pull mem_name
  pds_name = strip(pds_name)
  mem_name = strip(mem_name)

  say  'input PDS name=' pds_name
  say  'input member name =' mem_name

  the_pds  = "'"pds_name"'"
  X = OUTTRAP('ML.')
  "LISTDS "the_pds" MEMBERS"
  X = OUTTRAP('OFF')
  if mem_name = ':' then new_mem = strip(ML.7)  /* get first member */
  else do
 mo_re   = '0'
 new_mem = ''
 DO N = 7 TO ML.0
   if mo_re = '1' then do/* got last member name*/
  new_mem = strip(ML.N)  /* then get this as next   */
  leave  /* exit loop   */
   end
   if ML.N = mem_name then mo_re = '1'
 END
  end

  if new_mem = '' then do
 say 'no more member names'
 exit
  end

  say  'new member name   =' new_mem

  PDSIN = "'"pds_name"("||new_mem||")'"
  say 'allocating INFILE to' PDSIN
  "ALLOC FILE(INFILE) DSN("PDSIN") SHR"
  if rc /= 0 then do
 say 'alloc rc = ' rc
 exit
  end
  "EXECIO * DISKR INFILE (STEM INREC. FINIS"
  DO I = 1 TO INREC.0 /* read all the lines of the member */
 QUEUE INREC.I/* and queue them   */
  END
  "FREE  FILE(INFILE)"

  Queue "//CHECKRC EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(0,NE)   "
  Queue "//SYSTSIN  DD  * "
  Queue "  EXEC 'MY.EXEC(SUBNEXT)'"
  Queue "  " pds_name  "  "
  Queue "  " new_mem   "  "
  Queue "//SYSTSPRT DD  SYSOUT=*  "
  Queue "ZZ"
  "SUBMIT * END(ZZ)"
  EXIT

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


Re: Assembler calling DSNTAIR

2018-04-15 Thread John Gateley
I use this code to get the error message from DSNTIAR

CALL_PARM   DS  0F
PARM_1  DC  A(SQLCA)
PARM_2  DC  A(MSGLEN)
PARM_3  DC  A(MSGSIZE)

MSGSIZE DC  F'72'   LENGTH OF EACH LINE
MSGAREA DS  H,CL(20*72) 
ORG MSGAREA 
MSGLEN  DC  AL2(20*72)  20 lines of 72 bytes
MSG_TEXTDS  CL72
ORG   

LA  R1,CALL_PARM 
L   R15,=V(DSNTIAR) DSNTIAR EXPANDS THE ERROR
BASRR14,R15  

LA  R4,MSG_TEXT POINT TO FIRST 72 BYTE LINE
LA  R5,20   20 LINES
LOOPEQU *
output  72 bytes to wherever (check >= blanks)
LA  R4,72(,R4)
BCT R5,LOOP

Warning - there could be typos in the above.
You could also check R15 after the call and output a message if not 0. The 
routine used to have 8 lines but in V8 or V9 of DB2 we got RC=4 because the 
message did not fit. As a result we changed to 20 lines.

Hope it helps.

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


Sorting a REXX STEM variable

2017-06-12 Thread John Gateley
Hi

Last weeks discussion on sorting a REXX stem inspired me to write a program to 
do it.

example call to sort ascending
 "ISPEXEC LIBDEF ISPLLIB DATASET ID ('my_loadlib') STACK"
 "ALLOC FI(SORTPRT)  DUMMY" 
 r_c = SORTSTEM(my_stem_name,'A')
 "FREE FILE(SORTPRT)" 
 "ISPEXEC LIBDEF ISPLLIB "

SORTSTEM gets the variable count from my_stem_name.0 and then looks at every 
variable in the stem to get the maximum length.

Then it getmains some storage big enough for the maximum record plus 4 bytes 
for the length of the variable

It then calls the system SORT passing E15 and E35 exits

 SORT FIELDS=(1,max_len,BI,A),FILSZ=stem_count
 OPTION MSGDDN=SORTPRT 
 RECORD TYPE=F,LENGTH=(max_len+4)

On each call to the E15 exit the next stem variable is read, padded with spaces 
and the length put on the end

On each call to the E35 exit the variable is put back into the stem, starting 
at 1, using the original length


It will be on File#953 of the CBT Tape soon, but it anyone wants a preview then 
the code is in IEBUPDTE format here
http://www.spurtle.biz/STEMASM.txt
and supporting macros here
http://www.spurtle.biz/STEMMAC.txt
You will need to assemble the six modules then link
INCLUDE SYSLIB(STEMSORT)   
ENTRY STEMSORT 

Regards
John

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


Re: SDSF/REXX question

2017-06-01 Thread John Gateley
0.7 was by trial and error, 0.6 was not long enough for a single IEFBR14 job.

I already had the REXX assembler function so I only had to code this

JRGSTIM('7')

also I did not know about SYSCALL :-)

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


Re: SDSF/REXX question

2017-06-01 Thread John Gateley
I had a similar problem. In my case I was reading JESYSMSG to check the return 
codes of preceding steps and usually JESYSMSG was there but occasionally it was 
not, and in these cases the job elapsed time was quite low.
I added a call to an assembler program at the start of the REXX to issue a 
STIMER for 0.7 seconds and then JESYSMSG was always there.
The 0.7 works even when the only previous step is an IEFBR14.
Since then I have written an Assembler program to do the browse using DYNALLOC 
of USERID.JOBNAME.JOB01234.JESYSMSG and that does not need to sleep at all. So 
there does seem to be a delay in REXX/SDSF but I have no idea why.

Regards
John

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


Re: Assembler addressing issue

2017-05-21 Thread John Gateley
Hi

Try re-establishing the DSECT like this

DYNAREA DSECT 
 AAA  DS .. 
BBB   DS.. 
​ IEFZB4D0 
DYNAREA DSECT 
DYNMSG   WTO...,MF=L 

John

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


Re: Defined capacity?

2017-03-02 Thread John Gateley
Hi

Is this rexx what you are looking for?

http://www.longpelaexpertise.com/toolsLPinfoX.php

Regards
John

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


Re: Which STEPLIB concatenation is not authorized?

2017-02-24 Thread John Gateley
Hi

I know it's a while since this discussion, but file 953 on the cbttape latest 
updates page has two possible solutions for this.

Assembler program LISTAPF uses the code from Mark Zelden's IPLINFO to get a 
list of APF authorised datasets
it then gets all datasets concatenated to STEPLIB and reports any which are not 
in the APF list. Then it
does the same for JOBLIB.

Alternatively, assembler program GETDSNAM acts as a rexx function and populates 
a stem variable containing all
datasets concatenated to a DDNAME so the checking could be done in a batch rexx 
program.

Regards
John

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