Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us