I have a text file in mainframe unix filesystem that is ascii format. 
Bottom line is that in batch, I need to do a find/replace for certain data 
in it.

David,

Here is a sample JCL to find and replace the contents. first convert the 
ascii file to ebcdic using ATOE on INREC and then do the find and replace 
on OUTREC and then once again revert it back to ascii on OUTFIL

//STEP0100 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=* 
//SORTDIAG DD DUMMY 
//SORTIN   DD PATH='/tmp/tst.project.xml', 
//            PATHOPTS=ORDONLY, 
//            LRECL=2706,RECFM=FB,BLKSIZE=2706 
//SORTOUT  DD PATH='/tmp/tst.project.mod.xml', 
//            PATHMODE=(...), 
//            PATHOPTS=(...), 
//            PATHDISP=(...),FILEDATA=TEXT,
//            LRECL=2706,RECFM=FB,BLKSIZE=2706 
//SYSIN    DD * 
  OPTION COPY 
  INREC BUILD=(1,2706,TRAN=ATOE) 
 
  OUTREC FINDREP=(INOUT=(C'</configuration>', 
                         C'<Jousma, David>')) 

  OUTFIL BUILD=(1,2706,TRAN=ETOA) 
//* 

Thanks,
Kolusu
DFSORT Development
IBM Corporation

IBM Mainframe Discussion List <[email protected]> wrote on 
02/19/2016 01:32:38 PM:

> From: "Jousma, David" <[email protected]>
> To: [email protected]
> Date: 02/19/2016 01:33 PM
> Subject: JCL sample needed
> Sent by: IBM Mainframe Discussion List <[email protected]>
> 
> All,
> 
> Been scratching my head all afternoon on this.   I have a text file 
> in mainframe unix filesystem that is ascii format.   Bottom line is 
> that in batch, I need to do a find/replace for certain data in it.
> 
> Interactively, I know I can do it via ISPF with the EA(edit ASCII) 
> command.   But I need to do it in batch, so unless someone has a 
> clever way to do it, I'm thinking I need to copy it out to flat 
> file, convert to EBCDIC, make the changes, and then copy it back to 
> the unix filesystem from whence it came, converting it back to ascii
> and doing it in batch.
> 
> Tried ICETOOL with OUTREC...BUILD...TRAN=ATOE, tried FTP, but don't 
> seem to have the correct incantation to make that work, and I've 
> tried OGETX, but no good results.
> 
> Does anyone have some hints/tips to accomplish?
> 
> Thanks, Dave
> _________________________________________________________________
> Dave Jousma
> Assistant Vice President, Mainframe Engineering
> [email protected]
> 1830 East Paris, Grand Rapids, MI  49546 MD RSCB2H
> p 616.653.8429
> f 616.653.2717
> 
> This e-mail transmission contains information that is confidential 
> and may be privileged.
> It is intended only for the addressee(s) named above. If you receive
> this e-mail in error,
> please do not read, copy or disseminate it in any manner.  If you 
> are not the intended 
> recipient, any disclosure, copying, distribution or use of the 
> contents of this information
> is prohibited. Please reply to the message immediately by informing 
> the sender that the 
> message was misdirected. After replying, please erase it from your 
> computer system. Your 
> assistance in correcting this error is appreciated.
> 
> 
> 
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
> 



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to