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
 

 

Replace A to space in 10th position thru SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
maxsubrat

New User


Joined: 27 Feb 2008
Posts: 78
Location: india

PostPosted: Fri Apr 23, 2010 11:22 am    Post subject: Replace A to space in 10th position thru SORT
Reply with quote

I have a input file which has a character A in 10th position.
I want to replace it to space in that 10th position.

But i have other character in the file in position 10th. i don't want to change that.
Also i have character A in other column and i don't want to disturb that.

Please someone try for a SORT.
Thanks
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Apr 23, 2010 11:42 am    Post subject:
Reply with quote

Hi,

here is a couple of ways of doing this

Code:

//ALTSEQ   EXEC PGM=SORT                                             
//SORTIN   DD *                                                       
123456789A123456789                                                   
123456789B123456789                                                   
//SORTOUT  DD SYSOUT=*                                               
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                       
     SORT FIELDS=COPY                                                 
     ALTSEQ CODE=(C140)                                               
     INREC OVERLAY=(10:10,1,TRAN=ALTSEQ)                             
/*                                                                   
//OVERLAY  EXEC PGM=SORT                                             
//SORTIN   DD *                                                       
123456789A123456789                                                   
123456789B123456789                                                   
//SORTOUT  DD SYSOUT=*                                               
//SYSOUT   DD SYSOUT=*                                               
//SYSIN    DD *                                                       
   SORT FIELDS=COPY                                                   
   INREC IFTHEN=(WHEN=(10,1,CH,EQ,C'A'),OVERLAY=(10:C' '))           
/*                                                                   


Gerry
Back to top
View user's profile Send private message
maxsubrat

New User


Joined: 27 Feb 2008
Posts: 78
Location: india

PostPosted: Fri Apr 23, 2010 2:14 pm    Post subject: Reply to: Replace A to space in 0th position thru SORT
Reply with quote

This is working..

I have another requirement :

I have few records and i want to replace one character to space based on some condition:

1. those records have L in the 1st character of the record and
2. those records have A in the 10th character.

Then i want to replace the 10th character from A to space.

Please someone help me out..

Thanks
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: Fri Apr 23, 2010 9:59 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*                                                     
//SORTIN   DD DSN=...  input file                                                   
//SORTOUT  DD DSN=...  output file                                           
//SYSIN    DD *                                                   
   SORT FIELDS=COPY                                               
   INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'L',AND,10,1,CH,EQ,C'A'),       
     OVERLAY=(10:X))                                               
/*                                                                 


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
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 -> DFSORT/ICETOOL 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 Fileaid Update Replace with null string descann Compuware & Other Tools 4 Mon May 15, 2017 3:00 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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