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
 

 

how to replace blank " " with "." to column 1

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

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Mon Apr 13, 2015 11:21 pm    Post subject: how to replace blank " " with "." to column 1
Reply with quote

I'm new to this forum an have a special question...

how to delete space ' ' to first column member...

input:

Code:

    abcd efgh
  abcd efgh
      abcd efgh
        abcd efgh


noblank = space(input,0) but how to first the space from colum 1?

output:

Code:

abcd efgh
abcd efgh
abcd efgh
abcd efgh


then, how to replace the blank ' ' with '.'

mailto = TRANSLATE(input,' ','.') right??

output desidered:

Code:

abcd.efgh
abcd.efgh
abcd.efgh
abcd.efgh



thanks for your help.
Back to top
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Tue Apr 14, 2015 12:04 am    Post subject: Reply to: how to replace blank " " with "." to column 1
Reply with quote

I am not sure what do you mean when you say Column 1. What do you want to do at column 1?

Going by the rest of the post, I'll suggest you first use TRANSLATE and then STRIP function i.e. first translate all spaces to '.' and then remove leading and trailing '.' by STRIP function:

TRANSLATE(String,'.',' ')
STRIP(String,,'.')

Hope you get what you want.
Back to top
View user's profile Send private message
italo_pm

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Tue Apr 14, 2015 12:29 am    Post subject: Reply to: how to replace blank " " with "." to column 1
Reply with quote

thank RahulG31 for answer,

i want first cancel (delete) the space from colum 1 to the first letter for word...

from:
Code:

    abcd efgh
      abcd efgh
            abcd efgh
        abcd efgh


to:

Code:

abcd efgh
abcd efgh
abcd efgh
abcd efgh



then replace the space " " with "."

final result:

Code:

abcd.efgh
abcd.efgh
abcd.efgh
abcd.efgh



thanks...
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Tue Apr 14, 2015 12:35 am    Post subject: Reply to: how to replace blank " " with "." to column 1
Reply with quote

Not sure why would you want to do that in that particular order.

But you can easily do that by first STRIP the leading and trailing spaces. Then TRANSLATE all spaces to '.' and then STRIP the trailing '.'

I am sure there can be better ways but this is as quick as I can comment.
Back to top
View user's profile Send private message
italo_pm

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Tue Apr 14, 2015 12:42 am    Post subject: Reply to: how to replace blank " " with "." to column 1
Reply with quote

thanks again... i'm new in rexx language. ... i'm test tomorrow.
Back to top
View user's profile Send private message
italo_pm

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Tue Apr 14, 2015 1:54 pm    Post subject:
Reply with quote

edit:

hi i'm resolved in this way: SPACE(' abcd efgh ij ',1,'.')

Code:
address tso "execio * diskr CMAREAIN (stem CMAREAIN. finis"
 if rc>0 then exit 12
 CMAREAIN.1 = TRANSLATE(CMAREAIN.1)
 domain = "§domain.com"
 out = 0
do in=1 to CMAREAIN.0
      nincm = SPACE(CMAREAIN.in,1,'.')domain
      out=out+1
      CMAREAEM.out = nincm
      CMAREAEM.0   = out
      say ' - new string without space:' nincm
end


from:
Code:
    abcd efgh
      abcd efgh
            abcd efgh ij
        abcd efgh ij


to:

Code:

abcd.efgh§domain.com
abcd.efgh§domain.com
abcd.efgh.ij§domain.com
abcd.efgh.ij§domain.com


thanks for you help.
Back to top
View user's profile Send private message
italo_pm

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Tue Apr 14, 2015 4:16 pm    Post subject:
Reply with quote

hi again...

please, how to write "RCPT TO:<" and ">" for each line of my file in input?? maybe with push and pull option?? i'm confused..

from:

Code:
abcd.efgh§domain.com
abcd.efgh§domain.com
abcd.efgh.ij§domain.com
abcd.efgh.ij§domain.com


to:

Code:
RCPT TO:<abcd.efgh§domain.com>
RCPT TO:<abcd.efgh§domain.com>
RCPT TO:<abcd.efgh.ij§domain.com>
RCPT TO:<abcd.efgh.ij§domain.com>


any sample ??

thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Apr 14, 2015 5:27 pm    Post subject: Reply to: how to replace blank " " with "." to column 1
Reply with quote

something along the lines of

Code:

id.1 = "abc def"
id.2 = "    efg hij"
id.3 = " klm nop qrs  "
id.0 = 3

do    i = 1 to id.0
   od.i = "RCPT TO:<"space(id.i,1,'.')"@domain.com>"
end
od.0 = id.0

do    i = 1 to od.0
   say i od.i
end


to get

Code:

1 RCPT TO:<abc.def@domain.com>
2 RCPT TO:<efg.hij@domain.com>
3 RCPT TO:<klm.nop.qrs@domain.com>
Back to top
View user's profile Send private message
italo_pm

New User


Joined: 26 Mar 2015
Posts: 37
Location: Italy

PostPosted: Tue Apr 21, 2015 2:57 am    Post subject:
Reply with quote

thanks Enrico, i'm resolved this:

name
Code:
abc def       
    efg hij   
 klm nop qrs 


for fileout1
Code:
namerc = "RCPT TO:<"SPACE(name,1,'.')"@domain.com>"
fileout1.oucm =  namerc
fileout1.0=oucm


result fileout1

Code:
RCPT TO:<abc.def@domain.com>   
RCPT TO:<efg.hij@domain.com>   
RCPT TO:<klm.nop.qrs@domain.com>


and

for fileout2
Code:
nameto = "TO:"SPACE(name,1,'.')"@domain.com"
fileout2.oucm =  nameto
fileout2.0=oucm


resut fileout2

Code:
TO:abc.def@domain.com     
TO:efg.hij@domain.com     
TO:klm.nop.qrs@domain.com 


thanks for you help, again.
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 SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm


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