IBM Mainframe Discussion List <[email protected]> wrote on 05/29/2012 
11:24:27 AM:

> From: Ken Leidner <[email protected]>
> To: [email protected], 
> Date: 05/29/2012 11:24 AM
> Subject: Can DFSORT do pattern matching?
> Sent by: IBM Mainframe Discussion List <[email protected]>
> 
> I have a problem that I can solve with REXX ? but 
> would like ideas on how DFSORT, might be able to 
> perform the same function, since I am talking around 1,000,000 plus 
records.
> 
> As input I have a dataset with a list of dataset 
> names from a catalog (really several catalogs), 
> in columns 1 thru 44.  What I want to do is 
> include or exclude dataset names in the file 
> based on patterns like you might enter on ISPF 3.4
> 
>                  xxx.yyy.*.zzz.**
>                  ttttt.*.rrrrrrr.**
> 
> To make life easier a qualifier will be a value, 
> * or **.  It would be great if the process could 
> accept  bb*, but not a requirement.   Note that 
> there could be 100+ patterns to match, not just a few that could be 
hardcoded.
> 
> I know how to parse the DSN into qualifiers ? 
> painfully (is there a better way?)
> 
> PARSE=(%01=(ABSPOS=01,ENDBEFR=C'.',FIXLEN=8),
> %02=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8),
> %03=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8),
> %04=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8),
> %05=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8),
> %06=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8),
> %07=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8),
> %08=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8),
> %09=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8),
> %10=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8),
> %11=(ENDBEFR=C'.',ENDBEFR=C' ',FIXLEN=8)),
> 
> But how to get sort to accept the * or ** to 
> match anything?  I could maybe see a pre pass to 
> convert the trailing ** into a series of 
> *.*.*  ??  But I then there is the 
> zzzz.**.pppp.vvvv.** that would just ruin my 
> day.  Lets say that form is not valid.
> 
> Any ideas?  Code would be great, a concept or 
> process that DFSORT can perform is what I am looking for.
> 
> Ken Leidner                     [email protected]


Hi Ken,

DFSORT does not have Pattern matching function but there are ways to get 
the desired results. How many patterns do you think you will have for each 
run? If the extract patterns are less than 25, we can generate 
INCLUDE/OMIT cards for those and get the desired results. Send me an email 
with your sample input and patterns and let me see what I can do.



Sri Hari Kolusu
DFSORT Development
IBM Corporation
Email: [email protected]
Phone: 408-463-2403 Tie Line 543-2403

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to