user3528693
user3528693

Reputation: 11

How to recall an archived dataset if it is the current generation of a GDG

I tried 'HRECALL GTEMP.BATCH.FILE(0)' to recall the latest GDG generation and it returned and invalid dsn name error message.

However, using a similiar command, 'HRECALL GTEMP.BATCH.FLATFILE', recalls flat file as expected.

What did I do incorrectly?

Upvotes: 1

Views: 4897

Answers (1)

piet.t
piet.t

Reputation: 11911

I assume you are executing the command using some flavour of the TSO-Terminal-Monitor-Program, e.g. IKJEFT01.

Your problem is that TSO doesn't support addressing GDGs using relative generations, so it will interpret your (0) as a PDS-member-name instead of a generation.

So what are your options?

  1. Write a REXX-procedure to determine the DSN of the latest generation (e.g. GTEM.BATCH.FILE.G1234V00) and recall it.
  2. You can use JES-mechanisms to recall the file(s) in a separate job-step:

    //RECALL EXEC PGM=IEFBR14
    //DATASET1 DD DSN=GTEMP.BATCH.FILE(0),DISP=SHR
    //DATASET2 DD DSN=GTEMP.BATCH.FILE2(0),DISP=SHR

Option 2. is easy to implement but depending on your needs it might have two downsides:

  • The datasets will be recalled one after the other while HRECALL might recall several datasets in parallel
  • The step will only end after all datasets have been recalled (which might also be an advantage depending on your needs)

Upvotes: 1

Related Questions