Looking for DSNAME when using fromdsn command

Discussion of the Co:Z Toolkit Dataset Pipes utilities
Post Reply
Posts: 30
Joined: Mon Nov 02, 2009 10:47 pm

Looking for DSNAME when using fromdsn command

Post by sctebnt »

I need to get the DSNAME of the file currently being read. If my DDNAME is more than one DSNAME (concatenated) then as I move from reading the first file to the second file, I need the value of DSNAME to change.

This change in DSNAME triggers some specific logic to occur within our applications.

I am able to successfully execute bpxwdyn using the cozclient command, with args of 'info dd(mydd) inrtdsn(dsnvar)' tp get the DSNAME of a file that is allocated to my job step. However, when the DDNAME allocated to my job step is made up of multiple files concatenated together the bpxwdyn does not meet my needs and may not be the most efficient method to get DSNAME.

Do you know of a way to get the current value of DSNAME while we are processing (reading) file data fromdsn?

It would be great if fromsan were to maintain an environment variable with the DSNAME.

Sample JCL Code that I am trying to get DSNAME from:

Code: Select all

//         DD DISP=SHR,DSN=@17171.T.FLATFILE.B 
Site Admin
Posts: 2006
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

I think that you should be able to get this from a REXX USS script using something *like* this:

Code: Select all

/* REXX */
arg ddn
do i=1 by 1 until last<>0
  call bpxwdyn 'info inrelno('i') inrtddn(dd) inrtlst(last) msg(2)'
  if dd=ddn then leave
do i=i by 1 while last=0
  call bpxwdyn 'info inrelno('i') inrtddn(dd) inrtdsn(ds)',
               'inrtpath(path) inrtlst(last) msg(2)'
  if dd<>'' & dd<>ddn then leave
  if path<>'' then
     say path
     say ds
Post Reply