Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrieve file names from Catalog?

Status
Not open for further replies.

RNTH

Programmer
Jul 27, 2005
19
IN
Hi All,

I need to write a JCL which is able to retrieve file names from the catalog using the LISTCAT command.
The file names I need to retrieve from the catalog are something like,

STATIC1.STATIC2.DYNAMIC1.DYNAMIC2.DYNAMIC3

Here as the name indicates, the first 2 qualifiers are STATIC. But the last 3 will vary unpredictable.

I tried the LISTCAT command using IKJEFT01 which is given below.


//PS0010 EXEC PGM=IKJEFT01,REGION=0M
//SYSOUT DD SYSOUT=*
//SYSTSIN DD *
LISTCAT ENTRIES('STATIC1.STATIC2.*')
/*

But when we use astericks as given above, the LISTCAT will look only for 3 qualifiers. It will retrieve only file names like

STATIC1.STATIC2.DYNAMIC1

I tried some other options also like,

LISTCAT ENTRIES('STATIC1.STATIC2.*.*.*')
LISTCAT ENTRIES('STATIC1.STATIC2.**')

But these are also not working. Can somebody please help me telling a method to resolve this?

Thanks
RNTH
 
Try this:

LISTCAT LEVEL(STATIC1.STATIC2)

The book says it will return all catalog entries that start with STATIC1.STATIC2 regardless of how many additional levels are in its name.
 
Yes. That worked for me. Thank you !!
 
What does this have to do with COBOL?

If you do not like my post feel free to point out your opinion or my errors.
 
I couldn't find a JCL forum in Tek-Tips, and since the mainframe developers are familiar with both COBOL and JCL, I expected somebody would be able to help me.

That is why I posted in the COBOL discussion forum.

 
It was a reasonable forum guess. Sometimes the forum you are after doesn't exist and you have to use the grey matter to guess one that is close. I think you did OK in this instance, even though ceh4702 is correct in his question.

Personally I always feel that it's best to answer the question and then say 'but shouldn't this question have been posed in such and such a forum'. Don't get me wrong as ceh4702 was correct, it's just that different people do things different ways.

Anyhow, hope your question is now sorted.

Marc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top