space filling



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

space filling

Postby daemian » Wed Feb 01, 2012 7:33 pm

hi,
Is it correct one to replace a full column with space in a flat file.
   OPTION COPY                                                           
   INREC FINDREP=(INOUT=(5,4,C'   '))
daemian
 
Posts: 4
Joined: Wed Feb 01, 2012 6:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: space filling

Postby enrico-sorichetti » Wed Feb 01, 2012 7:40 pm

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
Last edited by enrico-sorichetti on Wed Feb 01, 2012 7:43 pm, edited 1 time in total.
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: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: space filling

Postby BillyBoyo » Wed Feb 01, 2012 7:42 pm

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'    ')
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: space filling

Postby Frank Yaeger » Wed Feb 01, 2012 11:48 pm

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
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: space filling

Postby daemian » Thu Feb 02, 2012 11:28 am

thank you so much frank and billy..
daemian
 
Posts: 4
Joined: Wed Feb 01, 2012 6:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: space filling

Postby Nik22Dec » Thu Feb 02, 2012 11:59 am

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.
Thanks,
Nik
User avatar
Nik22Dec
 
Posts: 68
Joined: Mon Dec 26, 2011 6:38 pm
Has thanked: 2 times
Been thanked: 0 time

Re: space filling

Postby Nik22Dec » Thu Feb 02, 2012 12:01 pm

Please note that INOUT works in pairs & hence, William will be replaced by Bill, Mike by Michael & so on.
Thanks,
Nik
User avatar
Nik22Dec
 
Posts: 68
Joined: Mon Dec 26, 2011 6:38 pm
Has thanked: 2 times
Been thanked: 0 time

Re: space filling

Postby BillyBoyo » Thu Feb 02, 2012 2:06 pm

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).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post