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.
Need to pull the list of datasets with particular HLQ
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Need to pull the list of datasets with particular HLQ
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).
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).
-
- Posts: 15
- Joined: Tue May 17, 2022 12:57 pm
- Skillset: Mainframe Developer
- Referer: Through Colleague
Re: Need to pull the list of datasets with particular HLQ
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!
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!
-
- Global moderator
- Posts: 3720
- Joined: Sat Dec 19, 2009 8:32 pm
- Skillset: Systems programming, SAS, COBOL, CICS, JCL, SMS, VSAM, etc.
- Referer: other forum
- Location: Dubuque, Iowa, USA
Re: Need to pull the list of datasets with particular HLQ
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.the size of files in bytes
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".
-
- Global moderator
- Posts: 3006
- Joined: Fri Apr 18, 2008 11:25 pm
- Skillset: tso,rexx,assembler,pl/i,storage,mvs,os/390,z/os,
- Referer: www.ibmmainframes.com
Re: Need to pull the list of datasets with particular HLQ
why reinvent the wheel
evaluate the use of the ISMF NAVIQUEST application
exhausting filtering and reporting ...
from the ISMF NAVIQUEST docs
evaluate the use of the ISMF NAVIQUEST application
exhausting filtering and reporting ...
from the ISMF NAVIQUEST docs
Code: Select all
//* USEDSPC - 0 to 9999999 (in Kilo Bytes)
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Need to pull the list of datasets with particular HLQ
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
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
-
- Posts: 15
- Joined: Tue May 17, 2022 12:57 pm
- Skillset: Mainframe Developer
- Referer: Through Colleague
Re: Need to pull the list of datasets with particular HLQ
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.
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.
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Need to pull the list of datasets with particular HLQ
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.
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.
-
- Posts: 15
- Joined: Tue May 17, 2022 12:57 pm
- Skillset: Mainframe Developer
- Referer: Through Colleague
Re: Need to pull the list of datasets with particular HLQ
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!
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!
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: Need to pull the list of datasets with particular HLQ
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.
try
c=outtrap('lst.')
"hrecall" ....
c=outtrap('off')
In any case, your CALL MSG('OFF'') after the HRECALL seems wrongly placed.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 0
- 1184
-
by stel
View the latest post
Wed Sep 21, 2022 1:06 pm
-
-
List all ControlM Conditions generic in a rexx
by jobschubse » Tue May 18, 2021 6:05 pm » in All Other Tools - 2
- 3725
-
by jobschubse
View the latest post
Wed May 19, 2021 11:29 am
-
-
- 4
- 10150
-
by Misha786
View the latest post
Tue Jul 18, 2023 11:26 pm