IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Wed Jul 27, 2016 12:52 am
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: 1788
Location: Bloomington, IL

PostPosted: Wed Jul 27, 2016 12:54 am
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Jul 27, 2016 1:19 am
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
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
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Jul 27, 2016 11:20 am
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

Global Moderator


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

PostPosted: Wed Jul 27, 2016 9:41 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Wed Jul 27, 2016 9:48 pm
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

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Jul 27, 2016 9:53 pm
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

Global Moderator


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

PostPosted: Thu Jul 28, 2016 12:00 am
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
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Fri Jul 29, 2016 10:48 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top