Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need a help how to replace a string in REXX based on cnditio

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
gurunath82

New User


Joined: 26 Jul 2016
Posts: 4
Location: INDIA

PostPosted: Tue Jul 26, 2016 11:43 pm    Post subject: Need a help how to replace a string in REXX based on cnditio
Reply with quote

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

Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Wed Jul 27, 2016 12:52 am    Post subject: Reply to: Need a help how to replace a string in REXX based on cnditio
Reply with quote

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

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Wed Jul 27, 2016 12:54 am    Post subject:
Reply with quote

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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Jul 27, 2016 1:19 am    Post subject:
Reply with quote

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

New User


Joined: 26 Jul 2016
Posts: 4
Location: INDIA

PostPosted: Wed Jul 27, 2016 9:10 am    Post subject:
Reply with quote

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

New User


Joined: 26 Jul 2016
Posts: 4
Location: INDIA

PostPosted: Wed Jul 27, 2016 9:17 am    Post subject:
Reply with 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.

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

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Jul 27, 2016 11:20 am    Post subject:
Reply with quote

Quote:
I am sorry, Unfortunately i am not able to share my code, because of security issues.


Same here.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Wed Jul 27, 2016 9:41 pm    Post subject: Reply to: Need a help how to replace a string in REXX based on cnditio
Reply with quote

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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Wed Jul 27, 2016 9:48 pm    Post subject:
Reply with quote

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

Active Member


Joined: 07 Feb 2009
Posts: 985
Location: Oostende, Belgium

PostPosted: Wed Jul 27, 2016 9:53 pm    Post subject: Re: Need a help how to replace a string in REXX based on cnditio
Reply with quote

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

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Thu Jul 28, 2016 12:00 am    Post subject: Reply to: Need a help how to replace a string in REXX based on cnditio
Reply with quote

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

New User


Joined: 26 Jul 2016
Posts: 4
Location: INDIA

PostPosted: Fri Jul 29, 2016 10:21 am    Post subject:
Reply with quote

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

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Fri Jul 29, 2016 10:48 am    Post subject:
Reply with quote

very good. let us know if you face any more issues also see how trace works so as to debug yourself.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unwrap the data based on delimiter X'25' bhavana yalavarthi DFSORT/ICETOOL 22 Fri Dec 09, 2016 10:25 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 1 Fri Dec 09, 2016 4:40 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us