Found it. IBM was nice enough to include the following proc in your SCEEPROC
library. It's handy if your file exists on the MVS side.
//EDCICONV PROC INFILE=, < INPUT DATA SET
// REGSIZ='6144K', < ICONV REGION SIZE
// OUTFILE=, < OUTPUT DATA SET
// FROMC=, < INPUT CODE SET NAME
// TOC=, < OUTPUT CODE SET NAME
// LIBPRFX='SYS1.CEE' < PREFIX FOR LIBRARY DSN
//*
//EDCICONV EXEC PGM=EDCICONV,REGION=®SIZ,
// PARM=('FROMCODE(&FROMC),TOCODE(&TOC)')
//STEPLIB DD DSNAME=&LIBPRFX..SCEERUN,DISP=SHR
//SYSUT1 DD DSNAME=&INFILE,DISP=SHR
//SYSUT2 DD DSNAME=&OUTFILE,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//ICONV EXEC PROC=EDCICONV,
// INFILE='EBCDIC.FILE',
// OUTFILE=ASCII.FILE',
// FROMC='IBM-037',
// TOC='UTF-8'
--
Donald Grinsell
State of Montana
406-444-2983
[email protected]
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
~ Benjamin Franklin
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]]
> On Behalf Of Jousma, David
> Sent: Friday, February 19, 2016 2:00 PM
> To: [email protected]
> Subject: Re: JCL sample needed
>
> John, thanks! I'll give that a shot.
>
> __________________________________________________________
> _______
> 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
>
>
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]]
> On Behalf Of John McKown
> Sent: Friday, February 19, 2016 3:54 PM
> To: [email protected]
> Subject: Re: JCL sample needed
>
> On Fri, Feb 19, 2016 at 2:32 PM, Jousma, David <[email protected]>
> wrote:
>
> > 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
> >
>
>
> Run a UNIX step using BPXBATCH. Use the //STDPARM DD to pass in a really
> long parameter line to do something like:
>
> //CHANGE EXEC PGM=BPXBATCH,REGION=0M
> //STDOUT DD SYSOUT=*
> //STDERR DD SYSOUT=*
> //STDIN DD *
> //STDPARM DD *
> SH
>
> cd /directory/containing &&
> cat ascii.file.txt |
> iconv -f ISO8859-1 -t IBM-1047 |
> sed -E 's/BUBBA/TROUBLE/g' |
> iconv -f IBM-1047 -t ISO8859-1 >new.file && mv new.file ascii.file.txt
> /*
> //
>
>
> This changes all occurrences of BUBBA to TROUBLE. This would be equivalent
> to the ISPF edit command: CHANGE 'BUBBA' 'TROUBLE' ALL . Note for this
> simple case, the -E (extended regexp) is not needed. If you could use some
> help with regular expressions, this is a good site:
> http://www.regular-expressions.info/tutorial.html . Or just post the ISPF
> CHANGE command that you'd like emulated using "sed". You could have
> multiple 'sed' commands to do multiple edits. Or you could do a single sed
> with multiple changes.
>
> Note in the above, the multiple lines are all "mushed together" as if it were
> a
> single long line. That is, the end-of-line doesn't indicate _anything_
> special. In
> fact, it is eliminated. That's why I have the && and
> | between commands. The && ensures that the command sequence stops
> on an
> error. And, of course, the pipe character, |, passes the data stream along.
>
>
> --
> The man has the intellect of a lobotomized turtle.
>
> Maranatha! <><
> John McKown
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send email to
> [email protected] with the message: INFO IBM-MAIN
>
> 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