View previous topic :: View next topic
|
Author |
Message |
Gabriel Araujo Alves
New User
Joined: 20 Jul 2010 Posts: 38 Location: Brazil
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Gabriel Araujo Alves
New User
Joined: 20 Jul 2010 Posts: 38 Location: Brazil
|
|
|
|
Thanks a lot... |
|
Back to top |
|
|
Gabriel Araujo Alves
New User
Joined: 20 Jul 2010 Posts: 38 Location: Brazil
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
Gabriel Araujo Alves
New User
Joined: 20 Jul 2010 Posts: 38 Location: Brazil
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
Gabriel Araujo Alves
New User
Joined: 20 Jul 2010 Posts: 38 Location: Brazil
|
|
|
|
Skolosu,
no problem. Thanks for the concern. |
|
Back to top |
|
|
|