David,
This sample JCL and REXX EXECs will run ISPF in batch to do the edit.
It will need a couple of changes to work on your system.
<path_to_dataset_to_edit> is the dataset to edit like /tmp/ascii.txt
<ispf_stock_messagelib> is the ISPF message library like SYS1.ISPMLIB
<ispf_stock_tablelib> is the ISPF table library like SYS1.ISPTLIB
//EDITASC EXEC PGM=IKJEFT1B,
// PARM='ISPSTART CMD(%EDITA <path_to_dataset_to_edit>)'
//*
//SYSEXEC DD DISP=SHR,DSN=<rexx_dataset>
//ISPPROF DD DSN=&&TMP1,
// DISP=(,PASS,DELETE),UNIT=SYSDA,SPACE=(TRK,(1,1,5)),
// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=0)
//ISPPLIB DD DSN=&&PL,
// DISP=(,PASS,DELETE),UNIT=VIO,SPACE=(TRK,(1,1,5)),
// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=0)
//ISPMLIB DD DSN=&&ML,
// DISP=(,PASS,DELETE),UNIT=VIO,SPACE=(TRK,(1,1,5)),
// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=0)
// DD DISP=SHR,DSN=<ispf_stock_messagelib>
//ISPSLIB DD DSN=&&SL,
// DISP=(,PASS,DELETE),UNIT=VIO,SPACE=(TRK,(1,1,5)),
// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=0)
//ISPTLIB DD DSN=&&TL,
// DISP=(,PASS,DELETE),UNIT=VIO,SPACE=(TRK,(1,1,5)),
// DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=0)
// DD DISP=SHR,DSN=<ispf_stock_tablelib>
//*
//ISPLOG DD SYSOUT=*,RECFM=VBA,LRECL=125,BLKSIZE=0
//ISPLIST DD SYSOUT=*,RECFM=FBA,LRECL=121,BLKSIZE=0
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//
EDITA REXX:
/*REXX*/
parse arg dsn
address ISPEXEC "EDIT FILE(dsn) MACRO(CHANGEIT) CONFIRM(NO) ASCII"
exit
CHANGEIT REXX:
/*REXX*/
address ISREDIT
"MACRO"
"RESET"
"CHANGE 'ascii.' 'ASCII!' ALL"
"SAVE"
"END"
Alan
Jousma, David 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
_________________________________________________________________
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