Need to pull the list of datasets with particular HLQ



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

Need to pull the list of datasets with particular HLQ

Postby Devrana » Tue May 17, 2022 1:03 pm

Hi All,

I have been trying to pull the datasets(PS) list using HLQ through IDCAMS utility but I tried with NONVSAM then I am getting the list of PS & PDS both. \

Could you please suggest how can I get the list of datasets(PS) for a particular HLQ.

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 willy jensen » Tue May 17, 2022 1:29 pm

You can't do that with JCL (IDCAMS is not JCL either).
You can use ISPF 3.4, save and edit the list. Or use one of the programs at CBTTAPE.ORG, though the only one with dataset type filter I'm aware of is the VTOC command in file 112. Maybe the new file 1025 can do it too, I haven't checked.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

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

Postby Devrana » Wed Jun 01, 2022 6:21 pm

Thanks Willy for your quick response!

Can we do it by using REXX ?
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 01, 2022 9:41 pm

Yes, you can use the ISPF LMxxxx services (see ISPF Services Guide).

1. LMDINIT
2. loop over LMDLIST .. STATS(YES) checking the ZDLDSORG variable for desired content, 'PS' in your case.
3. LMDFREE

Sample:
Address ispexec                                                    
 "control errors return"                                            
 if rc<>0 then call xmsg('You are not running under ISPF ('rc')')    
                                                                     
 arg p                                                              
 dsn=''                                                                    
 "LMDINIT LISTID(DSL) LEVEL("p")"                                    
 if rc>0 then exit xmsg('lmdinit' prm 'failed rc' rc)                
 do until rc<>0                                                      
   "LMDLIST LISTID("dsl") OPTION(LIST) DATASET(dsn) STATS(YES)"      
   if rc>8 then save 'lmdlist(list) failed rc' rc                    
   if rc=0 then say dsn ZDLDSORG ZDLDSNTP ZDLSIZE                    
 end                                                                
 "LMDLIST LISTID("dsl") OPTION(free)" /* DATASET(dsv)" */            
 "LMDFREE LISTID("dsl")"                                            
 Exit 0                                                              
                                                                     
xmsg:Address TSO "delstack";parse arg m;if m<>'' then say m;Exit 8  
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

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

Postby Devrana » Mon Jun 06, 2022 3:15 pm

Thanks a lot Willy!

It's working as expected.
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 Devrana » Thu Jun 23, 2022 2:40 pm

Hello Willy,

I need your assistance. Actually after getting the details of the files(PS) with particular qualifier, I run jobs(which runs eazytrieve code) inside rexx to calculate the file size of each file(ps) but if I have four files(ps) then I have to press "Enter" four time to get the filesize then the screen will display. Is there anyway to calculate the file size with rexx or is any option so that I don't have to press enter again again.

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 willy jensen » Thu Jun 23, 2022 2:58 pm

No need for Easytrieve. The STATS(YES) option causes a number of variables to be generated, amongst these is ZDLSIZE, which contains the data set size in tracks. Please read the description of the LMDLIST service in the ISPF Services guide manual for details of the information returned.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

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

Postby Devrana » Thu Jun 23, 2022 4:11 pm

Thanks Willy!

Can we covert tracks into bytes ? Actually I need to show the file size on the screen in kilobytes.
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 » Thu Jun 23, 2022 6:47 pm

That's where it gets complicated. A 3390 disk holds 56,664 bytes per track, but the actual amount depends on the blocksize of the dataset (they are not called files). Look at one capacity chart at http://www.legac-e.co.uk/JCLdocs/CAP3390.pdf
i.e at max blksize 27998 the track will hold 2 blocks = 55996 bytes, with blksize 80 the track will hold 78 blocks = 6240 bytes. Notes that these values are for fixed block datasets.
Or am sure that someone will correct me if I am wrong.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

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

Postby willy jensen » Sun Jun 26, 2022 3:50 pm

I found an algorithm, which I have converted to a callable REXX:
/*                                                                  rexx
 Return number of blocks for a given blksz on a 3390 track              
 Parameter: blksize                                                      
 Org: Arthur T                                                          
*/                                                                      
 arg blksz .                                                            
 b90 = roundup((blksz+6)/232)                                            
 b90 = 9 + (blksz + (6*b90) +6)/34                                      
 b90 = roundup(b90)                                                      
 return trunc(1729 / (10 + b90))                                        
Roundup: return trunc(arg(1)+0.9999)                  

Just keep in mind the following:
It only works for fixed-blocked non-compressed datasets.
On average the last track will only be half full.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post