Working without the LISTCAT verb

One difference between executing JCL and IDCAMS on the mainframe and using Elastic Batch Platform is that EBP does not maintain a "CATALOG" as all the files are either held in the operating system or within a relational store. 

This means that LISTCAT operations can be implemented using standard operating system commands such as "ls", on linux, or "dir" on Windows and there is no need for the LISTCAT verb to be implemented within EBP. 

EBP does contain information about files in a data control block file, ".dcb", found in the directories configured within EBP.  This is a Java property file which holds attributes on the file under the DSN of each file.

A judicious use of some OS utilities allows us to get a list of all the files listed in the ".dcb" and for example add them to a JCL using IDCAMS delete operations. 

For Unix we can use "sed" and "sort" to list all the files referenced within the ".dcb" file in the current working directory

So this command

sed -e 's/\([^-]*\)-.*/\1/' <.dcb | sort -u

will give us output like this

Then in JCL we can make the following entries
//DELT0010 EXEC PGM=IDCAMS           


For Windows we can use the all powerful, but slightly verbose, PowerShell to achieve the same result but recursively for all ".dcb" files beneath the current directory.

Get-ChildItem -Path .\** -Filter *.dcb -Recurse | Select-String -Pattern “(^.+?)[^ ](?=-)” | % { $_.Matches[0] } | % { $_.Value } | sort -Unique




Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk