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
 

 

Appending multiple texts to send message via REXX

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

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Fri Dec 12, 2014 5:01 am    Post subject: Appending multiple texts to send message via REXX
Reply with quote

Hello Everyone,

I am trying to append multiple messages and then send it to the user via REXX.

Below is what i am trying to achieve :-
Code:

 /** REXX  ***/                                                 
 MSG1 = 'THIS IS MESSAGE 1 '                                     
 MSG2 = 'THIS IS MESSAGE 2 '                                     
 MSG3 = 'THIS IS MESSAGE 3 '                                     
 MSG4 = 'THIS IS MESSAGE 4 '                                     
 MSG0 = TRANSLATE(MSG1 || MSG2 || MSG3 || MSG4)                 
 ADDRESS TSO 'SEND '|| "'MSG0'" ||' USER('||USERID()||') LOGON' 


the output should be the combination of messages stored in the variable MSG0 to user (in this case it will be me).

But presently i am not able to substitute the data inside MSG0 to put that into strings and send it to the user.

Thanks,
Rajat
Back to top
View user's profile Send private message

mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri Dec 12, 2014 12:55 pm    Post subject:
Reply with quote

Your quotes are not proper. Check the MSG0 quotes again.
Code:
ADDRESS TSO 'SEND '|| "'"MSG0"'" ||' USER('||USERID()||') LOGON'
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Fri Dec 12, 2014 2:37 pm    Post subject:
Reply with quote

Personally, I prefer using double quotes for TSO and other external commands. Many of them can include single quotes:
Code:
Address TSO "SEND '"Msg0"' USER("UserID()") LOGON"

And don't forget:
TSO/E User Guide wrote:
The message cannot exceed 115 characters, including blanks.

You can do too (it looks nicer on the receiver side):
Code:
Address TSO "SEND '"Left(Msg1,72)"' USER("UserID()") LOGON"
Address TSO "SEND '"Left(Msg2,72)"' USER("UserID()") LOGON"
Address TSO "SEND '"Left(Msg3,72)"' USER("UserID()") LOGON"
Address TSO "SEND '"Left(Msg4,72)"' USER("UserID()") LOGON"

In fact, you can also do (note: no trailing space in MSGs):
Code:
 /** REXX  ***/                                                 
 MSG1 = 'THIS IS MESSAGE 1'                                     
 MSG2 = 'THIS IS MESSAGE 2'                                     
 MSG3 = 'THIS IS MESSAGE 3'                                     
 MSG4 = 'THIS IS MESSAGE 4'                                     
 MSG0 = TRANSLATE(MSG1 MSG2 MSG3 MSG4)
(and TRANSLATE can be omitted if you have only uppercase text)
Back to top
View user's profile Send private message
prino

Active Member


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

PostPosted: Fri Dec 12, 2014 3:18 pm    Post subject:
Reply with quote

If you had used HILITE in edit you would immediately have seen what was wrong.
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 188
Location: india

PostPosted: Tue Dec 16, 2014 5:51 am    Post subject:
Reply with quote

Thanks a lot Marso, very informative and helpful

Regards,
Rajat
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 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 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. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm


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