FINDREPL or something else



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

FINDREPL or something else

Postby Asa » Tue Apr 06, 2010 7:53 pm

I've got an input file looking like this
120100329000000000047089755CT UDL 470 000000004500000513
120100329000000000047076766CT UDL 470 000000004500000514
120100329000000000047089755CT 415 000000004500000513
120100329000000000047076766CT 470 000000004500000514

If in a certain position a field with the length of 8 starts with 'UDL ' I want to remove the 'UDL ' and keep the rest of the
field.

In the exemple above I want the result to be
120100329000000000047089755CT 470 000000004500000513
120100329000000000047076766CT 470 000000004500000514
120100329000000000047089755CT 415 000000004500000513
120100329000000000047076766CT 470 000000004500000514

Can you please help me?
Asa
 
Posts: 4
Joined: Tue Apr 06, 2010 7:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FINDREPL or something else

Postby skolusu » Tue Apr 06, 2010 8:47 pm

ASA,

Use the following DFSORT JCL

//STEP0100  EXEC  PGM=SORT                               
//SYSOUT    DD SYSOUT=*                                 
//SORTIN    DD *                                         
120100329000000000047089755CT UDL 470 000000004500000513
120100329000000000047076766CT UDL 470 000000004500000514
120100329000000000047089755CT 415 000000004500000513     
120100329000000000047076766CT 470 000000004500000514     
//SORTOUT   DD SYSOUT=*                                 
//SYSIN     DD *                                         
  OPTION COPY                                             
  INREC FINDREP=(IN=C'UDL ',OUT=C'')                     
//*


will produce

120100329000000000047089755CT 470 000000004500000513
120100329000000000047076766CT 470 000000004500000514
120100329000000000047089755CT 415 000000004500000513
120100329000000000047076766CT 470 000000004500000514
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: FINDREPL or something else

Postby Asa » Wed Apr 07, 2010 1:10 pm

The spaces in the input-file disappears
I try to attach instead.
You do not have the required permissions to view the files attached to this post.
Asa
 
Posts: 4
Joined: Tue Apr 06, 2010 7:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FINDREPL or something else

Postby Frank Yaeger » Wed Apr 07, 2010 9:33 pm

Please use ubb code tags instead of attaching documents.

It appears that what you really want is to replace 'UDLbbxxx' in positions 48-55 with 'xxxbbbbb' (b for blank). If so, then you can use these DFSORT control statements:

  OPTION COPY                                                   
  INREC IFTHEN=(WHEN=(48,5,CH,EQ,C'UDL  '),OVERLAY=(48:53,3,5X))


If that's not what you want to do, then you need to do a better job of explaining exactly what it is you want to do.
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: FINDREPL or something else

Postby Asa » Wed Apr 07, 2010 10:53 pm

if the field contains this:
UDL 450
471
UDL 431
420

I want the result to be
450
471
431
420 and keeping the positions for the rest of the record
Asa
 
Posts: 4
Joined: Tue Apr 06, 2010 7:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FINDREPL or something else

Postby Frank Yaeger » Wed Apr 07, 2010 11:31 pm

The DFSORT job I gave you does that assuming the UDL field starts in position 48 (as shown in your attachment). Does it?

It appears that what you really want is to replace 'UDLbbxxx' in positions 48-55 with 'xxxbbbbb' (b for blank).


Is that what you want? If not, what exactly do you want? Where does the UDL field start? How long is it?
Also, what is the RECFM and LRECL of the input file?

Did you try running the job I gave you? What results did you get? I can only guess at your input and output since you seem to be unwilling to use ubb code tags to show what they really look like, and/or give the position/length of the field.
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: FINDREPL or something else

Postby Asa » Thu Apr 08, 2010 1:16 pm

I'm sorry I don't know what ubb code tags is

I did not read your message yesterday when I was still at work.

I've now tried your suggested IFTHEN and it works perfect - thank you very much!


BR
Ã…sa
Asa
 
Posts: 4
Joined: Tue Apr 06, 2010 7:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: FINDREPL or something else

Postby Frank Yaeger » Thu Apr 08, 2010 9:28 pm

ubb code tags are like this, but you actually use [ and ] instead of < and >:

<code>
your code
</code>

It's basically just a fixed-font so it preserves the spacing - for example:

   SORT FIELDS=(5,4,CH,A)
   INREC IFOUTLEN=20,
      IFTHEN=(WHEN=INIT,
         OVERLAY=(20:C'ABC'))
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