Page 1 of 1

space filling

PostPosted: Wed Feb 01, 2012 7:33 pm
by daemian
hi,
Is it correct one to replace a full column with space in a flat file.
   OPTION COPY                                                           
   INREC FINDREP=(INOUT=(5,4,C'   '))

Re: space filling

PostPosted: Wed Feb 01, 2012 7:40 pm
by enrico-sorichetti
what happened when You tried ?
but why use FINDREP when a simple BUILD or OVERLAY would be probably perform better ?

see here for

DFSORT Smart tricks
http://www.ibm.com/support/docview.wss? ... g3T7000094

or read about sort advanced functionalities starting from
http://www.ibm.com/support/docview.wss? ... g3T7000079

also remember that out of context question will usually lead to incomplete answers

Re: space filling

PostPosted: Wed Feb 01, 2012 7:42 pm
by BillyBoyo
If you want to replace position 5 for a length of 4 with space for each record on your file:

  OPTION COPY
  INREC OVERLAY=(5:C'    ')

Re: space filling

PostPosted: Wed Feb 01, 2012 11:48 pm
by Frank Yaeger
daemian,

The syntax you used for FINDREP is not correct. This would be a better choice for what you want to do:

   OPTION COPY
   INREC OVERLAY=(5:4X)


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080

Re: space filling

PostPosted: Thu Feb 02, 2012 11:28 am
by daemian
thank you so much frank and billy..

Re: space filling

PostPosted: Thu Feb 02, 2012 11:59 am
by Nik22Dec
Hi,

Please find below an example on how to use FINDREP -

  OPTION COPY
  OUTREC FINDREP=(INOUT=(C’William’,C’Bill’,
     C’Mike’,C’Michael’,C’Dog’,C’Beagle’,C’*’,C’#’))


Please note that this example is just for your refernce & will not solve the purpose.

Re: space filling

PostPosted: Thu Feb 02, 2012 12:01 pm
by Nik22Dec
Please note that INOUT works in pairs & hence, William will be replaced by Bill, Mike by Michael & so on.

Re: space filling

PostPosted: Thu Feb 02, 2012 2:06 pm
by BillyBoyo
Also be aware that in the example shown, searching will start at the beginning of the record and end when the search can no longer be fulfilled (ie nearly the end of the record). If there are multiple occurences of the IN values, there will be multiple changes.

These effects can be modified by STARTPOS, ENDPOS and DO. There are also options to control the effects of the replacement (if potentially causing the output record to be longer).