Elardus Engelbrecht, You just need to define a symbol for the current date and you can use it in FINDREP. You do not code OPTION COPY when you use COPY verb of ICETOOL. Here is a sample
//SELECT EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //SYMNAMES DD * CURRDATE,S'&LYR4.&LMON.&LDAY' //DFSMSG DD SYSOUT=* //PRINT DD SYSOUT=* //INVOER DD * .... E-MAIL SUBJECT AND BODY --1234567890 CONTENT-TYPE: TEXT/PLAIN; CHARSET=US-ASCII; NAME="NEVER USED IDS - YYYYMMDD.TXT" CONTENT-DISPOSITION: ATTACHMENT; FILENAME="NEVER USED IDS - YYYYMMDD.TXT" ..... REPORT ... --1234567890 CONTENT-TYPE: TEXT/PLAIN; CHARSET=US-ASCII; NAME="REVOKED IDS - YYYYMMDD.TXT" CONTENT-DISPOSITION: ATTACHMENT; FILENAME="REVOKED IDS - YYYYMMDD.TXT" ..... REPORT .... //TOOLIN DD * COPY FROM(INVOER) TO(PRINT) USING(SORT) //SORTCNTL DD * OUTREC FINDREP=(IN=C'YYYYMMDD',OUT=CURRDATE) /* btw is there a reason as to why you chose ICETOOL? Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> wrote on 09/13/2016 08:36:18 AM: > From: Elardus Engelbrecht <elardus.engelbre...@sita.co.za> > To: IBM-MAIN@LISTSERV.UA.EDU > Date: 09/13/2016 08:36 AM > Subject: DFSORT - ICETOOL - Search for text and replace with date > Sent by: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> > > Good day to all DFSORT gurus > > Background: I have setup an automated e-mail reporting system which > grab reports from various inputs, then I use IEBGENER to build up > one PS file containing data in this sequence: e-mail body - report - > boundary data - next report - ... etc ... > > (In this way I can send out e-mails to my clients where each e-mail > is containing anything from 1 to 10 attachments.) > > That PS file is then send over to SMTP to go out. Those boundary > lines are used to define various attachments containing reports for > outgoing e-mails. > > Now, a client asked whether it is possible to insert run date in the > file names of those attachments for easy retrieval at a later stage. > > What I want to do is to dynamically replace a specific string into > date of run in the filenames of the attachment in the e-mail. > > So, for example I have this FILENAME="Never Used Ids - YYYYMMDD.TXT" > > I wish to replace above line with today's date using ICETOOL FINDREP > or a similar command. > > So that example line should be changed to this for today: > FILENAME="Never Used Ids - 2016-09-13.TXT" > > I have tried out this JCL to scan whole input and replace the > YYYYMMDD to rundate, but ICETOOL just shouts RC=16 saying invalid > syntax found: > > //SELECT EXEC PGM=ICETOOL > //TOOLMSG DD SYSOUT=* > //DFSMSG DD SYSOUT=* > //PRINT DD SYSOUT=* > //INVOER DD * > > .... e-mail subject and body > > --1234567890 > CONTENT-TYPE: TEXT/PLAIN; CHARSET=US-ASCII; NAME="Never Used ids - > YYYYMMDD.TXT" > CONTENT-DISPOSITION: ATTACHMENT; FILENAME="Never Used ids - YYYYMMDD.TXT" > > ..... report ... > > --1234567890 > CONTENT-TYPE: TEXT/PLAIN; CHARSET=US-ASCII; NAME="Revoked ids - YYYYMMDD.TXT" > CONTENT-DISPOSITION: ATTACHMENT; FILENAME="Revoked ids - YYYYMMDD.TXT" > > ..... report .... > > //TOOLIN DD * > COPY FROM(INVOER) TO(PRINT) USING(SORT) > //SORTCNTL DD * > OPTION COPY > OUTREC FINDREP=(IN=C'YYYYMMDD',OUT=DATE1(-)) > > As you can see those YYYYMMDD can be on any place in the input lines. > > I only want to change those boundary lines, nothing else. Otherwise > I have to use some editing tools on the datasets containing the > original boundary lines. > > Any clues please? Are any other free products available which can do > that tricks? > > Many thanks in advance. > > Groete / Greetings > Elardus Engelbrecht > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN