Page 1 of 1

Omit Datasets with Dates

PostPosted: Fri Sep 20, 2019 8:15 am
by joelquit
Hi,

I have a file containing a list of datasets. I need to omit datasets having dates. The dates can have different formats and positions (sample below). Is there a way to omit them via sort or any other utility?

PROCESS.PRD.LOADLIB.D170830
CEY.PFX.JCLLIB.BKUP.D290419
CNX.SFX.V35ANAB.MACLIB.D2015124

Thanks in advance

Re: Omit Datasets with Dates

PostPosted: Fri Sep 20, 2019 2:38 pm
by NicC
Yes. But you would probably have to hand code each different date.

Re: Omit Datasets with Dates

PostPosted: Fri Sep 20, 2019 3:39 pm
by enrico-sorichetti
The dates can have different formats and positions


assuming that a <date> qualifier is in the format zNNNNNNN

a rexx script along the lines of


/* rexx */

Trace "O"

list.1 = "PROCESS.PRD.LOADLIB.D170830"
list.2 = "CEY.PFX.D290419.JCLLIB.BKUP"
list.3 = "CNX.SFX.V35ANAB.MACLIB"
list.4 = "CNX.D2015124.SFX.V35ANAB.MACLIB"
list.5 = "CEY.PFX.JCLLIB.BKUP.NODATE"
list.6 = "CNX.SFX.V35ANAB.MACLIB.D2015124"


list.0 = 6

do  i = 1 to list.0

    temp = list.i
    has_date = 0
    do while ( temp \= "" )
        parse var temp qual "." temp
        if verify( substr(qual,2) ,"1234567890" ) = 0 then do
            has_date = 1
            leave
        end
    end
    if  has_date = 1 then ,
        iterate
    say "kept " i list.i
end

 

will do it


kept  3 CNX.SFX.V35ANAB.MACLIB
kept  5 CEY.PFX.JCLLIB.BKUP.NODATE