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: 75
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: 75
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts JCL sort Match and NoMatch rakeshsekar1987 SYNCSORT 2 Thu Feb 02, 2017 10:26 pm


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