INCLUDE and regular expression



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

INCLUDE and regular expression

Postby Zarx » Tue Jan 22, 2008 6:29 pm

Hey everybody :)

I have a little problem with the include statement and the sub strings.

I have a file with DSNs :

TOTO.TITI25678TATA
TOTO.TITI25TATA
TOTO.TITI85TATA
TOTO.TITI659TATA
TUTU.154785
TOTO.TITI59
...

And I need sort it and just include the DSNs which follow that mask : TOTO.TITI*TATA
But it seems DFSORT don't handle the regular expressions or maybe I didn't understand how it works.
It was easy create an include statement like that include cond=(1,44,SS,EQ,C'TOTO.TITI*TATA') but it didn't work...

And as the DSNs have different lengh I don't know how create my mask with the correct include syntax.

Anyone can help me plz ?

Kind regards :)
Zarx
 
Posts: 3
Joined: Tue Jan 22, 2008 6:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INCLUDE and regular expression

Postby arunprasad.k » Tue Jan 22, 2008 6:42 pm

Zarx,

You can use the following JCL. But I would suggest to wait for experts comments.

//S01     EXEC PGM=SORT                                                 
//SORTIN  DD *                                                         
TOTO.TITI25678TATA                                                     
TOTO.TITI25TATA                                                         
TOTO.TITI85TATA                                                         
TOTO.TITI659TATA                                                       
TUTU.154785                                                             
TOTO.TITI59                                                             
/*                                                                     
//SORTOUT DD SYSOUT=*                                                   
//SYSOUT  DD SYSOUT=*                                                   
//SYSIN   DD *                                                         
 SORT FIELDS=COPY                                                       
 INCLUDE COND=(1,44,SS,EQ,C'TOTO.TITI',AND,1,44,SS,EQ,C'TATA')         
/*                                                                     


Output:
TOTO.TITI25678TATA
TOTO.TITI25TATA   
TOTO.TITI85TATA   
TOTO.TITI659TATA   


Arun.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INCLUDE and regular expression

Postby Zarx » Tue Jan 22, 2008 6:59 pm

Hum... Thx but in fact my problem is more complex eheh sorry :P

I need match TOTO.TITI*TATA.TUTU*TETE
and if I write that :
include cond=(1,9,SS,EQ,C'TOTO.TITI',AND,1,44,SS,EQ,C'TATA.TUTU',AND,1,44,SS,EQ,C'TETE')


It will include TOTO.TITITETETATA.TUTU which is not right :(

I think now you can understand my real problem.

But thx anyway for the beginning of the solution.
Zarx
 
Posts: 3
Joined: Tue Jan 22, 2008 6:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INCLUDE and regular expression

Postby Frank Yaeger » Tue Jan 22, 2008 10:22 pm

I think now you can understand my real problem.


I'm not sure I do.

Are you looking for a way to create a mask with an * meaning "anything in between"?

TOTO.TITI*TATA - does this mean 'TOTO.TITI' followed by any number of characters followed by 'TATA'? If so,it can be done with DFSORT's PARSE function like this:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
TOTO.TITI25678TATA
TOTO.TITI25TATA
TOTO.TITI85TATA
TOTO.TITI659TATA
TUTU.154785
TOTO.TITI59
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  INREC PARSE=(%=(STARTAFT=C'TOTO.TITI'),
    %01=(STARTAT=C'TATA',FIXLEN=4)),
    OVERLAY=(81:%01)
  SORT FIELDS=(1,44,CH,A)
  OUTFIL INCLUDE=(81,4,CH,EQ,C'TATA'),BUILD=(1,80)
/*


SORTOUT would have:

TOTO.TITI25TATA         
TOTO.TITI25678TATA     
TOTO.TITI659TATA       
TOTO.TITI85TATA         


I need match TOTO.TITI*TATA.TUTU*TETE


Does this mean 'TOTO.TITI' followed by any number of characters followed by 'TATA.TUTU' followed by any number of characters followed by 'TETE''? If so you could use a simialar DFSORT job to do it like this.

//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
TOTO.TITI*TATA.TUTU*TETE
TOTO.TITI15
TOTO.TITI823TATA.TUTU52
TOTO.TITI134TATA.TUTU831TETE
TOTO.TITI1TATA.TUTU00TETE
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  INREC PARSE=(%=(STARTAFT=C'TOTO.TITI'),
    %=(STARTAFT=C'TATA.TUTU'),
    %01=(STARTAT=C'TETE',FIXLEN=4)),
    OVERLAY=(81:%01)
  SORT FIELDS=(1,44,CH,A)
  OUTFIL INCLUDE=(81,4,CH,EQ,C'TETE'),BUILD=(1,80)
/*


SORTOUT would have:

TOTO.TITI*TATA.TUTU*TETE     
TOTO.TITI1TATA.TUTU00TETE   
TOTO.TITI134TATA.TUTU831TETE


If that's not what you want, then you need to explain more clearly what you do want with better examples of input and output.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: INCLUDE and regular expression

Postby Zarx » Wed Jan 23, 2008 12:52 pm

It was exactly that :)
You are amazing man thank you very much.

My problem is solved, thanks a lot.

Kind regards ;)
Zarx
 
Posts: 3
Joined: Tue Jan 22, 2008 6:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INCLUDE and regular expression

Postby Frank Yaeger » Wed Jan 23, 2008 11:43 pm

Glad I could help.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post