Substring anywhere in the record



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

Substring anywhere in the record

Postby whowillwait4u » Wed Feb 22, 2012 7:22 pm

Hi,

I have input data as shown below.
// DD DSN=abcd
// 7456546 DD DSN=efgh
// 666 DD DSN=ijkl
// DD DSN=mnop 909
// 6545 DD DSN=qrst

output should be:

abcd
efgh
ijkl
mnop
qrst

Could you please help...?
whowillwait4u
 
Posts: 15
Joined: Fri Feb 17, 2012 2:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Substring anywhere in the record

Postby enrico-sorichetti » Wed Feb 22, 2012 7:46 pm

how is the substring terminated ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3002
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Substring anywhere in the record

Postby BillyBoyo » Wed Feb 22, 2012 8:16 pm

That doesn't look like valid DD names, but if that is what you have, some amendment of Kolusu's post from here: http://ibmmainframes.com/about57422.html might do you.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Substring anywhere in the record

Postby Frank Yaeger » Wed Feb 22, 2012 11:37 pm

whowillwait4u,

Assuming the DSN=name field ends with a blank and that the name can be up to 44 bytes long, you can use a DFSORT job like the following:

//S1 EXEC PGM=SORT                                               
//SYSOUT DD SYSOUT=*                                             
//SORTIN DD DSN=...  input file                   
//SORTOUT DD DSN=...  output file                                 
//SYSIN DD *                                                     
  OPTION COPY                                                   
  INREC PARSE=(%1=(STARTAFT=C'DSN=',ENDBEFR=C' ',FIXLEN=44)),   
    BUILD=(%1)                               
/*
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