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
 
SORT to Find and Replace accent alphabet to normal alphabet

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

Active User


Joined: 29 Jun 2005
Posts: 116

PostPosted: Thu Jul 24, 2014 11:44 pm    Post subject: SORT to Find and Replace accent alphabet to normal alphabet
Reply with quote

Hi,

I tried to write a SORT to find and replace the below accent characters to normal characters which will be in Name field in my input file .

áÁâÂÄÄáÁãÃåÅ Replace with A
éÉêÊëËèÈ Replace with E
íÍîÎïÏìÌ Replace with I
óÓôÔÖÖòÒõÕ Replace with O
úÚûÛÜÜùÙ Replace with U
ýÝ Replace with Y
çÇ Replace with C
ñÑ Replace with N

& - special character will be converted to the word AND

Code:

//FINDREP JOB(A,B,C),'SRT FRGN',CLASS=S,MSGCLASS=X,REGION=0M,NOTIFY=&SYSUID
//SORT010    EXEC PGM=SORT
//SORTWK01   DD UNIT=SYSDA,SPACE=(CYL,(5,10),RLSE)
//SORTIN     DD DSN=INP.FILE, DISP=SHR
//SOROUT     DD DSN=OUT.FILE,DISP=SHR
//SYSIN DD *
      OPTION COPY
      INREC IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=44,ENDPOS=100,
      IN=(C'á',C'Á',C'â',C'Â',C'Ä',C'á',C'Á',C'ã',C'Ã'),OUT=C'A'))


/*
//
As i need to continue for other accent characters in IN statement . I would like to know how to do this .  Can any one help me on this .

Thanks
Balaji K
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Jul 25, 2014 12:06 am    Post subject: Reply to: SORT to Find and Replace accent alphabet to normal
Reply with quote

You want to continue a statement? Just break at a comma, and start on the next line. Lots of examples showing that. Or do you mean something else?
Back to top
View user's profile Send private message
balaji81_k

Active User


Joined: 29 Jun 2005
Posts: 116

PostPosted: Fri Jul 25, 2014 12:09 am    Post subject: Reply to: SORT to Find and Replace accent alphabet to normal
Reply with quote

Hi Bill Woodger,

I meant to continue the IN statements for all accent characters and corresponding OUT statement for its conversion .Please let me know how to do that ?

Thanks
Balaji K
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 197
Location: Chennai

PostPosted: Fri Jul 25, 2014 1:56 pm    Post subject: Reply to: SORT to Find and Replace accent alphabet to normal
Reply with quote

Use multiple IFTHEN=( like this..

I would recommend to use Hex of all these value rather than a character.

Code:

OPTION COPY                                                     
INREC IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=1,ENDPOS=80,         
IN=(C'á',C'Á',C'â',C'Â',C'Ä',C'á',C'Á',C'ã',C'Ã'),OUT=C'A')),   
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=1,ENDPOS=80,               
IN=(C'é',C'É',C'ê',C'ë',C'è',C'È'),OUT=C'E'))                   


Hope this helps.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Jul 25, 2014 3:11 pm    Post subject: Reply to: SORT to Find and Replace accent alphabet to normal
Reply with quote

Either use INOUT and specify all the pairs. Can use symbols/SYMNAMEs to document and simplify code and reduce maintenance.

Or, probably better, use ALTSEQ.
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 OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am

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