Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Repalcing a particular field of a file using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
dineshsjce
Currently Banned

New User


Joined: 16 Apr 2007
Posts: 41
Location: Bangalore

PostPosted: Thu Sep 25, 2008 9:09 pm    Post subject: Repalcing a particular field of a file using SORT
Reply with quote

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
View user's profile Send private message

gorman
Currently Banned

New User


Joined: 23 Sep 2008
Posts: 10
Location: Chennai

PostPosted: Thu Sep 25, 2008 9:33 pm    Post subject: Use File-Aid for replace.
Reply with quote

Hi,

You can use batch File-Aid to meet your requirement....... It is tested and working...... icon_biggrin.gif

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...... icon_wink.gif

Thanks.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Sep 25, 2008 9:37 pm    Post subject:
Reply with quote

An external variable can be accessed as in JCL with a file as input in sort.....
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Sep 25, 2008 10:14 pm    Post subject:
Reply with quote

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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us