View previous topic :: View next topic |
Author |
Message |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Sat Feb 21, 2009 8:59 pm Post subject: Replace string with shorter string and shift ? |
|
|
Hello,
Is there a way to replace a string with a shorter string and have the trailing characters shifted left ?
Here is an example:
From:
MY NAME IS WILLIAM SMITH AND I LIVE IN FLORIDA.
To:
MY NAME IS BILL SMITH AND I LIVE IN FLORIDA.
(I only want to specify 'WILLIAM SMITH' and 'BILL SMITH' in the control cards....)
Thanks for any help. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Sat Feb 21, 2009 10:25 pm Post subject: |
|
|
tcurrier,
You could use the following DFSORT JCL to replace all instances of 'william smith' in your input records with 'Bill smith', shift the bytes after the replaced constants to the left, and pad on the right with blanks.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC FINDREP=(IN=C'WILLIAM SMITH',OUT=C'BILL SMITH')
/* |
If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).
For complete details on the new FINDREP and the other new functions available with PTF UK90013, see:
www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Sun Feb 22, 2009 10:14 am Post subject: |
|
|
Thanks, Kolusu.... our shop apparently only has SYNCSORT and FILEAID... I tried the FILEAID EDITALL function, but that doesn't seem to shift the characters.
I've been meaning to ask this for a while, so now's the time I guess....
Why, if our shop uses SYNCSORT and not DFSORT, am I able to execute programs ICEMAN and ICETOOL ? I thought these were part of (or entry points for) DFSORT ? |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Sun Feb 22, 2009 11:23 am Post subject: |
|
|
often the entry points for DFSORT and SYNCSORT are the same. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Sun Feb 22, 2009 11:24 am Post subject: |
|
|
Both DFSORT and Syncsort ship SORT and ICEMAN as aliases for the respective products. Syncsort has also chosen to ship ICETOOL as an alias for SYNCTOOL.
PGM=SORT and PGM=ICEMAN will invoke the sort product at your site.
PGM=ICETOOL wlll invoke DFSORT's ICETOOL if you have DFSORT, or Syncsort's SYNCTOOL if you have Syncsort.
Note that DFSORT does NOT ship SYNCSORT or SYNCTOOL as aliases, but many shops that migrate from Syncsort to DFSORT create those aliases themselves.
So you can't tell which product you have by how it is invoked - you have to look at the messages it produces - ICExxxs for DFSORT, or WERxxxx and SYTxxxs for Syncsort. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Sun Feb 22, 2009 12:29 pm Post subject: |
|
|
tcurrier wrote: | Thanks, Kolusu.... our shop apparently only has SYNCSORT and FILEAID... I tried the FILEAID EDITALL function, but that doesn't seem to shift the characters. |
tcurrier,
If I remember correctly Fileaid only shifts the data left when there are no spaces after the change string and the adjacent data. So try providing a space after the search string
ex (untested code):[code:1:41dfe1fa7d]EDITALL=(1,0,C |
|
Back to top |
|
 |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Sun Feb 22, 2009 4:13 pm Post subject: |
|
|
OK, I tried that, with the following result:
Code: | ********************************* Top of Data ****
MY NAME IS BILL SMITHAND I'M FROM FLORIDA.
******************************** Bottom of Data ** |
|
|
Back to top |
|
 |
Brian Wood Beginner
Joined: 14 Jan 2009 Posts: 37 Topics: 0 Location: USA
|
Posted: Mon Feb 23, 2009 9:28 am Post subject: |
|
|
tcurrier: SyncSort for z/OS 1.3.2.0 contains support for FINDREP. Please contact us at zos_tech@syncsort.com if we can be of any assistance. _________________ Brian Wood
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com |
|
Back to top |
|
 |
tcurrier Intermediate
Joined: 10 Feb 2006 Posts: 188 Topics: 68
|
Posted: Mon Feb 23, 2009 10:22 am Post subject: |
|
|
Thanks... I'm an applications programmer, so I'm not in a position to order new software.... but we currently only have version 1.3.1.0 |
|
Back to top |
|
 |
|
|