View previous topic :: View next topic
|
Author |
Message |
dineshsjce Currently Banned New User
Joined: 16 Apr 2007 Posts: 41 Location: Bangalore
|
|
|
|
Hi Friends,
I have a file which contains:
CD DEKIDAKA
CD DOWNLOAD
PUT 'THE.DEKI.APL' TEST1.TXT
QUIT
My requirement is that, in place of TEST1.TXT I need to copy some string (This string varies, it is not constant) from another file. Only TEST1.TXT I need to change, remaining things I want as it is.
How can I accomplish this using SORT? |
|
Back to top |
|
|
gorman Currently Banned New User
Joined: 23 Sep 2008 Posts: 10 Location: Chennai
|
|
|
|
Hi,
You can use batch File-Aid to meet your requirement....... It is tested and working......
Code: |
//STEP2 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD *
PUT 'THE.DEKI.APL' TEST1.TXT
//DD01O DD SYSOUT=*
//SYSIN DD *
$$DD01 COPY REPL=(20,C'WHATEVERTEXTYOUWANTTOCHANGE.TXT')
//*
|
Hope it helps......
Thanks. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Dinesh,
Here's a DFSORT job that will do what you asked for. Replace NEWNAME.TXT with whatever new file name you need. The SYMNAMES record can be in a file with RECFM=FB and LRECL=80 if that's what you need.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
New_file,'NEWNAME.TXT'
/*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC FINDREP=(IN=C'TEST1.TXT',OUT=New_file)
/*
|
You can put the SYMNAMES record in a separate file with RECFM=FB and LRECL=80 if appropriate. In that case, just use this SYMNAMES DD:
//SYMNAMES DD DISP=SHR,DSN=...
The job uses DFSORT's new FINDREP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you don't have this PTF, ask your System Programmer to install it (it's free).
For complete details on the new FINDREP function and the other new functions available with PTF UK90013, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|