Looking for DSNAME when using fromdsn command

Discussion of Dovetailed Technologies Dataset Pipes tools
Post Reply
sctebnt
Posts: 30
Joined: Mon Nov 02, 2009 10:47 pm

Looking for DSNAME when using fromdsn command

Post by sctebnt » Mon Apr 11, 2011 11:28 am

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

//DATAIN   DD DISP=SHR,DSN=@17171.T.FLATFILE.A 
//         DD DISP=SHR,DSN=@17171.T.FLATFILE.B 

dovetail
Site Admin
Posts: 1850
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail » Wed Apr 13, 2011 12:36 pm

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
end
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
   else
     say ds
end

Post Reply