View previous topic :: View next topic
|
Author |
Message |
gurunath82
New User
Joined: 26 Jul 2016 Posts: 4 Location: INDIA
|
|
|
|
Hi,
I am new to REXX . Based on Forums i built a new CLIST panel and i am passing /accessing the values from the panel. My inputs are bank name, input string and replacing string.
My input file strucure is like below
PRIN AAAAAAAAAAAAAAAAA CITI 11111111111
CUTOFF TIME 01:00
CITY NAME : NEWYORK
PRIN AAAAAAAAAAAAAAAAA ICIC 222222
CUTOFF TIME 02:00
CITY NAME : NEWYORK
My requirement is I want to check whether ACRO is matching which received from the panel, if matches i want to replace the string which i received from the panel.
Ex: From panel ACRO : ICIC, CITY NAME: NEW JERSY
So exactly for ICIC the CITY name should change in the file. Other should remain same.
Expected output:
PRIN AAAAAAAAAAAAAAAAA CITI 11111111111
CUTOFF TIME 01:00
CITY NAME : NEWYORK
PRIN AAAAAAAAAAAAAAAAA ICIC 222222
CUTOFF TIME 02:00
CITY NAME : NEWJERSY
My ACRO( Bank Name) is in position 40 and every time bank name should start with PRIN.( Firt 4 charters).
It would be great if any one can reply with code. We tired all possible ways but no luck, for updating the file.( need to check PRIN in first 4 positions and also acro name, if acro matches i want to replace the string).
Appreciate your help on this.
Thank you. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Quote: |
It would be great if any one can reply with code. |
Good luck with that!
Quote: |
We tired all possible ways |
Doubtful.
I think you will get better help if you show us your code and describe better what problem it has.
Show us:
1. how you are searching for the ACRO value
2. how you write out the file. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Your post has one major technical error (there is no such thing as a CLIST panel) and one major rules violation (you did not use Code tags to format your data). Moreover, you have committed the enormity of asking for code without offering payment. PM me and I will explain how you can exchange Rs, 6,000 for the solution. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Welcome!!
Is that what you want?
if Bank Name = 'ICIC' then some Rexx function to overlay CITY NAME with the input value else do nothing? |
|
Back to top |
|
|
gurunath82
New User
Joined: 26 Jul 2016 Posts: 4 Location: INDIA
|
|
|
|
YES Rohit.
The Bank name is 40 position. When ever the Bank name matches i have to overlay the CITY NAME.
Thanks for looking into it. |
|
Back to top |
|
|
gurunath82
New User
Joined: 26 Jul 2016 Posts: 4 Location: INDIA
|
|
|
|
As per my requirement, Under bank name there may 30 to 40 fields, Some times i may get requirement like change the cutoff name or chnage the city name, change the country name...etc. That's why i went to replace/overlay the string.
It would be great if any one share the code based on condition ( particular position Field matches), need to overlay the next matching string if not matches, we can just display the like string not found and come out of the loop.( no need to update the file).
I am sorry, Unfortunately i am not able to share my code, because of security issues. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Quote: |
I am sorry, Unfortunately i am not able to share my code, because of security issues. |
Same here. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Quote: |
because of security issues. |
Nobody is expecting you to divulge company secrets or sensitive personal information. However, I do not believe that three or four lines of rexx code will contain either. (if they do, you should replace the sensitive information with bogus information to alleviate your security concerns.) |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Quote: |
As per my requirement, Under bank name there may 30 to 40 fields, Some times i may get requirement like change the cutoff name or chnage the city name, change the country name...etc. That's why i went to replace/overlay the string.
|
What is that you think is difficult in achieving to what you said? You need SUBSTR - To check the bank name and OVERLAY - To replace the values from the panel OR The easiest way is to search this forum and you would find 100s of examples discussed but you have to spend time and nobody will code for you here. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
gurunath82 wrote: |
... We tired all possible ways but no luck, for updating the file. ... |
gurunath82 wrote: |
... I am sorry, Unfortunately i am not able to share my code, because of security issues. ... |
<cynic mode on>
Those two utter bulls*** comments tell me you've done f***-all yourself and are just looking for someone else to do your work for you!
</cynic mode on> |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
Quote: |
looking for someone else to do your work for you! |
I think the secret that you do not to divulge is that you are not qualified to do this task. |
|
Back to top |
|
|
gurunath82
New User
Joined: 26 Jul 2016 Posts: 4 Location: INDIA
|
|
|
|
Thanks All.
I got this. Thanks Rohit, i also got same thought in my mind and i implemented this on Wednesday. In Rexx Manuals, i found sub string concept. I read current record and used substring function to check first 4 bytes and 40 to 4 bytes, if my condition is matching i set a flag to Y. Again continued reading each record when ever my input string is matches for the exact position and FALG=Y. If both are satisfied i replaced the string and set flag "N".
Thanks all once again your suggestions. . |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
very good. let us know if you face any more issues also see how trace works so as to debug yourself. |
|
Back to top |
|
|
|