MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Replace string with shorter string and shift ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Sat Feb 21, 2009 8:59 pm    Post subject: Replace string with shorter string and shift ? Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Sat Feb 21, 2009 10:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Sun Feb 22, 2009 10:14 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Sun Feb 22, 2009 11:23 am    Post subject: Reply with quote

often the entry points for DFSORT and SYNCSORT are the same.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sun Feb 22, 2009 11:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Sun Feb 22, 2009 12:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Sun Feb 22, 2009 4:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
Brian Wood
Beginner


Joined: 14 Jan 2009
Posts: 37
Topics: 0
Location: USA

PostPosted: Mon Feb 23, 2009 9:28 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
tcurrier
Intermediate


Joined: 10 Feb 2006
Posts: 188
Topics: 68

PostPosted: Mon Feb 23, 2009 10:22 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group