IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to supress a character???


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Fri Mar 02, 2012 10:49 pm
Reply with quote

i have this sortin. lrecl=080

Code:
 
//SORTIN    DD  *             
D'AVILA                       
D'A'VILA                       
D'AVI'LA                       
D AVILA                       
D AVI LA                       
D AV  ILA                     
/*                             


and i want to supress this character ' (apostrophe) and i want this sortout.

Code:



DAVILA                       
DAVILA                       
DAVILA                       
D AVILA                       
D AVI LA                       
D AV  ILA   


how can i do this?? please someone help me,
thk's
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Mar 02, 2012 11:47 pm
Reply with quote

You can use a DFSORT job like the following:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
D'AVILA
D'A'VILA
D'AVI'LA
D AVILA
D AVI LA
D AV  ILA
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC FINDREP=(IN=C'''',OUT=C'')
/*


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:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080
Back to top
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Sat Mar 03, 2012 12:20 am
Reply with quote

Thanks a lot...
Back to top
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Tue Mar 06, 2012 2:54 am
Reply with quote

Frank Yaeger

when i use this code.

Code:
 
INREC FINDREP=(STARTPOS=1,ENDPOS=20,IN=X'00',OUT=C'')


the positions after field 20 are being displaced, how can i preserve
the fields out of this range???? I hope u can help-me, thanks.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Mar 06, 2012 3:01 am
Reply with quote

Gabriel Araujo Alves wrote:
Frank Yaeger

when i use this code.

Code:
 
INREC FINDREP=(STARTPOS=1,ENDPOS=20,IN=X'00',OUT=C'')


the positions after field 20 are being displaced, how can i preserve
the fields out of this range???? I hope u can help-me, thanks.


Use SHIFT=NO to preserve the fields . so change your control cards to the following

Code:

INREC FINDREP=(STARTPOS=1,ENDPOS=20,SHIFT=NO,IN=C'''',OUT=C'')
Back to top
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Tue Mar 06, 2012 3:21 am
Reply with quote

This way, the findrep does not works anymore. look at my code.

Code:


//S1 EXEC PGM=SORT                                                   
//SYSOUT DD SYSOUT=*                                                 
//SORTIN DD *                                                         
D'AVILA             |                                                 
D'A'VILA            |                                                 
D'AVI'LA            |                                                 
D AVILA             |                                                 
D AVI LA            |                                                 
D AV  ILA           |                                                 
//SORTOUT DD SYSOUT=*                                                 
//SYSIN DD *                                                         
  OPTION COPY                                                         
  INREC FINDREP=(STARTPOS=1,ENDPOS=20,SHIFT=NO,IN=C'''',OUT=C'')     
/*                                                                   



and my sortout.

Code:


D'AVILA             |
D'A'VILA            |
D'AVI'LA            |
D AVILA             |
D AVI LA            |
D AV  ILA           |



does not suppress the field anymore.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Tue Mar 06, 2012 6:20 am
Reply with quote

Hi,

I agree with you that SHIFT=NO is not working as intended, this might be a work around

Code:
  OPTION COPY                                                         
  INREC BUILD=(21,60,1,20)                                           
  OUTREC FINDREP=(STARTPOS=61,ENDPOS=80,IN=C'''',OUT=C'')             
  OUTFIL BUILD=(61,20,1,60)                                           


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

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Tue Mar 06, 2012 10:00 pm
Reply with quote

Your "IN" parameter changed int he middle of the thread... make sure you still have the apostrophe instead of X'00', both in the data and the parm card.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Mar 07, 2012 12:55 am
Reply with quote

Gabriel Araujo Alves,

I am sorry I made a mistake. You need to use the approach shown by gcicchet by copying the contents to be changed to end of the record and overlaying it back later.
Back to top
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Wed Mar 07, 2012 1:50 am
Reply with quote

Skolosu,

no problem. Thanks for the concern.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts String has hex character need to conv... COBOL Programming 3
No new posts Output LREC based on specific character DFSORT/ICETOOL 22
No new posts Replacing character string in file th... JCL & VSAM 9
No new posts Problem while sending special charact... JCL & VSAM 4
Search our Forums:

Back to Top