Page 2 of 3

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Wed Jun 29, 2022 5:22 pm
by Devrana
Hello Willy,

Thanks for the solution!

Is it a right way to calculate the number of bytes by multiplying the no of records by record length of FB file ? Please advise.

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Wed Jun 29, 2022 9:59 pm
by willy jensen
no,
1. use the algorithm to calculate the number of blocks per track, using the dataset blocksize as input.
2. multiply the number of allocated tracks by the number of blocks per track to get the total number of blocks.
3. multiply the total number of blocks by the blocksize to get the number of bytes.
4. subtract the number of blocks on half a track times the blocksize to get the adjusted number of bytes.

Forget the (logical) record length, the algorithm deals with blocks (which in some cases are called physical records).

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Fri Jul 01, 2022 2:16 pm
by Devrana
Thanks Willy!

I am not clear with the point number four. I tried to explain you my understanding with below example. Please correct me if I am wrong anywhere.

1- For my file the ZDLBLKSZ i.e. dataset blocksize is 27920. So by suing the algorithm the number of blocks per track are coming as 2.
2- Allocated tracks i.e. ZDLSIZE is 1 for my file. So no of allocated tracks * no of blocks = 1 * 2 => Total no of blocks are 2.
3- For my file the ZDLBLKSZ i.e. dataset blocksize is 27920 and total no of blocks are 2. So Number of bytes = 27920 * 2 = 55840
4- Adjusted no of bytes = (((1/2 * ZDLSIZE i.e. allocated tracks) * (ZDLBLKSZ i.e. dataset blocksize)) - No of blocks)
So, Adjusted no of bytes = (((1/2*1)*(27920)) - 2) = 13958.

Is the output of point no 3 is the size of files in bytes ? Please confirm.

Thanks in Advance!

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Fri Jul 01, 2022 9:53 pm
by Robert Sample
the size of files in bytes
I think you need to think long and hard about what you mean here. If you mean ALLOCATED size, then tracks used times blocks per track times bytes per block gets you the allocated size. If you want USED size, that is entirely a different matter since used bytes can be affected by the RECFM, the number of records, and so forth.

One example: you have 350 80-byte records that you load into a 1-track data set you allocate as DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=27920. The ALLOCATED space will be 2 blocks so 27920 times 2 or 55,840 bytes. The USED space will be 350 times 80 or 28,000 bytes. If you allocate the data set using 1 cylinder, the ALLOCATED space will be 837,600 bytes but the USED space will still be 28,000 bytes. Both numbers represent the "size of the file" but in different meanings of "size".

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Fri Jul 01, 2022 10:37 pm
by enrico-sorichetti
why reinvent the wheel
evaluate the use of the ISMF NAVIQUEST application
exhausting filtering and reporting ...
from the ISMF NAVIQUEST docs

//* USEDSPC - 0 to 9999999 (in Kilo Bytes)

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Sun Jul 03, 2022 3:35 pm
by willy jensen
As Robert Sample mentions, beware if you are talking about allocated or used tracks.
The number of bytes in allocated tracks is number_of_allocated_tracks * blocks_per_track * blksize.
My post dealt with number of used bytes.

Point number four is based on the assumption is that on average the last used track is half full.

A perhaps simpler formula, where # means 'number of':

#_used_bytes_in_ds = (#_used_tracks - 0.5) * #_blocks_per_track * blksize

So in your sample with blksize=27920 and just one used track the #_of_used_bytes_in_ds will be 27920.0

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Fri Jul 08, 2022 3:48 pm
by Devrana
Thanks Willy and Enrico!

Willy,

I would like to recall the migrated datasets on the basis of particular high level qualifier. for example for HLQ = 'PRTQ, I need to recall all the migrated datasets. Is using ZDLMIGR only way to recall the datasets? I tried it but HRECALL didn't work with ZDLMIGR.
Please assist here.

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Fri Jul 08, 2022 6:34 pm
by willy jensen
Did you read the manual? How did you use the ZDLMIGR value for recall?
The manual says "ZDLMIGR Whether the data set is migrated (YES or NO) based on the value of the VOLUME_OF_MIGRATED_DATA_SETS keyword in the ISPF configuration table. If the volume name of the data set matches the value of VOLUME_OF_MIGRATED_DATA_SETS, ZDLMIGR is set to YES, otherwise it is set to NO."
Which I take to mean 'it depends'.

However I would expect the ZDLVOL value to be MIGRAT for migrated datasets (I don't have a system to verify on). So if that is the case then do the HRECALL using the dataset name.

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Mon Jul 11, 2022 5:32 pm
by Devrana
Thanks Willy!

It's working but I am not able to suppressed the messages of HRECALL command. Below is the commands which I am running.

ADDRESS TSO "HRECALL '"DSVAR"' NOWAIT"
CALL MSG('OFF')

Could you please suggest any way to suppress the messages.

Thanks in advane!

Re: Need to pull the list of datasets with particular HLQ

PostPosted: Mon Jul 11, 2022 10:55 pm
by willy jensen
Not sure that you can trap or suppress HRECALL messages...
try

c=outtrap('lst.')
"hrecall" ....
c=outtrap('off')

In any case, your CALL MSG('OFF'') after the HRECALL seems wrongly placed.