View previous topic :: View next topic
|
Author |
Message |
pankaj1002
New User
Joined: 30 Jul 2012 Posts: 18 Location: India
|
|
|
|
I want to replace a certain string in one dataset with value taken from another dataset-
Dataset1:-
XXX@@@ P0000001 YYYYY
AAAAAAAAABBBBBBBBCCC
P0000001.XXXXXXXXXXXX
Dataset2:-
P000005
like in this example i need to replace all P0000001 in dataset1 to P000005 which it should read from Dataset2.
Probably SORT can do it but I need help urgently, thanks[/b] |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Have a look at this. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
or at this
www.ibmmainframes.com/viewtopic.php?t=59655&highlight=
Quote: |
I need help urgently |
who in hell cares
remember
we reply on our own time and free of charge
in other words when and if we feel like
there is no commitment to reply,
there should be no expectation to get an answer |
|
Back to top |
|
|
pankaj1002
New User
Joined: 30 Jul 2012 Posts: 18 Location: India
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
while I agree that both links posted do not tackle the variable position,
as far as my link is concerned it would be enough to omit the include/exclude logic! |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
It's too bad that you don't know COBOL or Rexx, Pankaj; it would a trivial thing to write a program in those languages to perform this task, instead of begging for sort control cards that you can't understand. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
p@nk@j~,
Did you look at the other link at all?
If your data is variable as to its position, how about looking at how to use FINDREP? Which is "find" as in look for something in a position that does not have to be known and "replace" which means "replace". As long as you manage to get the arguments the same length, nothing else will "move" in your data. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
p@nk@j~,
Do you know the strings to be replaced ?
What I mean to ask is
Code: |
XXX@@@ P0000001 YYYYY
AAAAAAAAABBBBBBBBCCC
P0000001.XXXXXXXXXXXX |
Will P0000001 change from run-run? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As has been mentioned, a public forum is not the best place for help if the issue is "urgent".
If you do need this so quickly, suggest you consider an implementation using something you know rather than trying to get someone to provide a Sort solution (or any other).
Which sort product is being used?
I believe you can do what you want using SYMNAMES and FINDREP if you intend to pursue the sort solution. There are many examples in the forum. |
|
Back to top |
|
|
|