Need to pull the list of datasets with particular HLQ



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

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

Postby Devrana » Wed Jun 29, 2022 5:22 pm

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.
Devrana
 
Posts: 12
Joined: Tue May 17, 2022 12:57 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby willy jensen » Wed Jun 29, 2022 9:59 pm

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).
willy jensen
 
Posts: 397
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 57 times

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

Postby Devrana » Fri Jul 01, 2022 2:16 pm

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!
Devrana
 
Posts: 12
Joined: Tue May 17, 2022 12:57 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby Robert Sample » Fri Jul 01, 2022 9:53 pm

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".
Robert Sample
Global moderator
 
Posts: 3693
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 275 times

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

Postby enrico-sorichetti » Fri Jul 01, 2022 10:37 pm

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)
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-sorichetti
Global moderator
 
Posts: 2979
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 160 times

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

Postby willy jensen » Sun Jul 03, 2022 3:35 pm

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
willy jensen
 
Posts: 397
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 57 times

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

Postby Devrana » Fri Jul 08, 2022 3:48 pm

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.
Devrana
 
Posts: 12
Joined: Tue May 17, 2022 12:57 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby willy jensen » Fri Jul 08, 2022 6:34 pm

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.
willy jensen
 
Posts: 397
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 57 times

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

Postby Devrana » Mon Jul 11, 2022 5:32 pm

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!
Devrana
 
Posts: 12
Joined: Tue May 17, 2022 12:57 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby willy jensen » Mon Jul 11, 2022 10:55 pm

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.
willy jensen
 
Posts: 397
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 57 times

PreviousNext

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post