Page 1 of 1

REXX Find a member that contains a file

PostPosted: Wed May 02, 2018 7:26 pm
by villasg
Hi,

I try to find a member pds that contains a dataset name using rexx language ? Thank's

Re: REXX Find a member that contains a file

PostPosted: Wed May 02, 2018 9:21 pm
by Terry Heinze
If this is a 1 time only task, you could always use the SRCHFOR function in ISPF:
 Menu  Functions  Confirm  Utilities  Help
ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
MNPC#1  DSLIST    xxxxxx.AAA.CNTL                       Row 0000014 of 0000257
Command ===> SRCHFOR DATASET                                  Scroll ===> CSR
           Name     Prompt       Size   Created          Changed          ID
_________ AMSPRINT *Found          22  2015/09/21  2015/09/21 15:49:00  xxxxxx
_________ AMSTEST                  19  2014/02/28  2017/08/17 14:37:00  xxxxxx
_________ AMSXSTCC                 33  2017/02/03  2017/06/26 15:53:00  xxxxxx
_________ AMSXSTRC                 38  2017/06/26  2017/06/26 15:53:00  xxxxxx
_________ ANLIMGJB                 36  2018/04/27  2018/04/30 14:09:00  xxxxxx
_________ ANLIMGPR                578  2018/04/27  2018/04/30 14:22:00  xxxxxx
_________ BIGGERPE *Found          55  2015/01/20  2018/05/01 15:56:00  xxxxxx
_________ BIGGERPO *Found          54  2013/11/25  2017/11/24 09:13:00  xxxxxx
_________ CCTEST                    1  2017/06/14  2017/06/14 08:40:00  xxxxxx
_________ CLASS                    30  2017/03/21  2017/03/21 14:12:00  xxxxxx
_________ CMPLWOXP                 85  2014/07/18  2015/01/16 14:16:00  xxxxxx
_________ CMPLWXP                  86  2014/12/29  2015/02/05 08:31:00  xxxxxx
_________ CNTAMS                   18  2016/12/13  2016/12/13 13:35:00  xxxxxx
_________ CNTSYNC                  18  2016/12/13  2016/12/13 11:30:00  xxxxxx
_________ COPY                     26  2014/02/20  2017/03/01 10:32:00  xxxxxx
_________ COPYEMF                  61  2017/01/27  2018/04/23 10:04:00  xxxxxx
_________ COPYENV                  47  2018/04/23  2018/04/23 10:38:00  xxxxxx
_________ CPYBKPOS                 62  2015/11/12  2018/01/18 14:10:00  xxxxxx

Re: REXX Find a member that contains a file

PostPosted: Wed May 02, 2018 9:35 pm
by Pedro
Use the SUPERC utility to search the PDS. From rexx, you can allocate the DD's required and use the TSO CALL command to launch SUPERC.

Re: REXX Find a member that contains a file

PostPosted: Wed May 02, 2018 10:13 pm
by villasg
Thank's for your answer but I have to introduce it into a rexx development

Re: REXX Find a member that contains a file

PostPosted: Wed May 02, 2018 11:14 pm
by prino
Invoke ISRSUPC from REXX...
"alloc f(olddd) da("!g.0dsn_o.i") shr reu"
"alloc f(newdd) da("!g.0dsn_n.i") shr reu"
"alloc f(sysin) da('"ispdyn"(superc"!g.0su.pid")') shr reu"
"alloc f(outdd) dummy reu"

"call *(isrsupc) 'DELTAL,LINECMP,"s_sparm"'"

select
  /***************************************************************
  * No differences or error on OLDDD                             *
  ***************************************************************/
  when rc =  0 |,
       rc = 28 then
    do
      "del" !g.0dsn_o.i
    end

Sheesh, was that so hard?