View previous topic :: View next topic | Author | Message | Priyanka Pyne New User Joined: 09 Feb 2008 Posts: 95 Location: India | | | | Hi, In my REXX code there is a variable where I am editing some values. The variable is like Code: | ORC=ST1","ED1","VRX1"X,", ST2","LN2","VRX2"X,", ST3","LN3 | The last ',' (comma) I used is for continuation to next line. But because of this one blank is coming unnecessarily. It is coming as Code: | ORC= 1,4,5, 2,5,6, 3,6 | But my expectation is Code: | ORC= 1,4,5,2,5,6,3,6 | Can any one tell me where I am doing the mistake? | | Back to top | | | Bill Woodger Moderator EmeritusJoined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix | | | | What are you trying to do with the X? Have you tried something like to trace the intermediate values? | | Back to top | | | Priyanka Pyne New User Joined: 09 Feb 2008 Posts: 95 Location: India | | | | Hi Bill, Actually I am substituting the values in a sort card. The code snippet is slightly wrong. It has to be Code: | ORC= 1,4,5x, 2,5,6x, 3,6 | These values are getting substituted in the skel JCL. Hence trace is not hlpng me. | | Back to top | | | Akatsukami Global Moderator Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL | | | | Using a comma to continue a string constant implicitly infixes an extra space. Do this: Code: | ORC=ST1","ED1","VRX1"X," ||, ST2","LN2","VRX2"X," ||, ST3","LN3 | | | Back to top | | | Bill Woodger Moderator EmeritusJoined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix | | | | Quote: | These values are getting substituted in the skel JCL. Hence trace is not hlpng me. | You already have the solution, from the learned (you have to get the emphasis correct on that one, think of courtroom dramas from the UK...) Mr Akatsukami. Next time you have a snippet you think you can't trace, copy it somewhere else where there is nothing else to interfere with it, and then trace it. | | Back to top | | | Mickeydusaor Active User Joined: 24 May 2006 Posts: 258 Location: Salem, Oregon | | | | There are several to do this.. Code: | ORC = ST1||','||ED1||','||VRX1||'X,'||, ST2||','||LN2||','||VRX2||'X,'||, ST3||','||LN3 | | | Back to top | | | Priyanka Pyne New User Joined: 09 Feb 2008 Posts: 95 Location: India | | | | Thanks Akatsukami. It is working fine now. But I really didn't inderstood how it is working. If you can put some light on it then it it will be helpful. | | Back to top | | | Akatsukami Global Moderator Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL | | | | Priyanka Pyne wrote: | Thanks Akatsukami. It is working fine now. But I really didn't inderstood how it is working. If you can put some light on it then it it will be helpful. | As you will know, there are three ways of doing string concatenation in Rexx: - With an explicit concatenation operator. The result of
Code: | foo = "BAR" foo = foo || "ABBAS" say foo | is "BARABBAS". - By abutting the arguments. The result of
Code: | foo = "BAR" foo = foo"ABBAS" say foo | is also "BARABBAS". - By listing the arguments as rvalues (to the right of the assignment operator). The result of
Code: | foo = "BAR" foo = foo "ABBAS" say foo | is "BAR ABBAS". Note the infixed space; listing the arguments as rvalues implicitly concatenates a space between each one. Now, look at your code snippet: Code: | ORC=ST1","ED1","VRX1"X,", ST2","LN2","VRX2"X,", ST3","LN3 | This is a concatenation of type 2, by abutting arguments; thus you expected no spaces in ORC. However, the MVS Rexx interpreter handles continued lines by concatenating the two lines and replacing the comma with a space. Thus, it reformatted your statement as Code: | ORC=ST1","ED1","VRX1"X," ST2","LN2","VRX2"X," ST3","LN3 | with spaces as indicated. The use of an explicit concatenation operator overrides the other two means of concatenation (because when the interpreter find a concat operator, it discards any whitespace to either side), so it gives the desired result. | | Back to top | | | Priyanka Pyne New User Joined: 09 Feb 2008 Posts: 95 Location: India | | | | Thanks a lot for explaining this elaborately. | | Back to top | | | surbhi jain New UserJoined: 10 Feb 2012 Posts: 7 Location: INDIA | | | | Hi I tried using the above concatination technique, but still i am getting error as continuation line missing , i am using it in include condition as below: Code: | PUSH " INCLUDE COND=("SKEY","LENGTH",CH,"R1",C"STNG"),AND, ("SKEY2",'L2",CH,"R2",C"STNG2")" | In above example i am taking the values of SKEY, LENGTH and all from the pannel and trying to apply search condition based on two conditions and after "AND" i want it to continue the line and take both serach criteria into account. Can you please let me know how is it possible. thanks in advance | | Back to top | | | enrico-sorichetti Superior Member Joined: 14 Mar 2007 Posts: 10828 Location: italy | | | | each line of a group must be properly terminated looks like the first one is not... when concatenating <strings> in a multiline statement it is wiser to use, across the continuation the explicit concatenation operator reread and meditate on the answers given and it will be easy to find the glitch anyway the <string> was badly formatted try with Code: | say " INCLUDE COND=("SKEY","LENGTH",CH,"R1",C'"STNG"'),AND,("SKEY2","LENGTH2",CH,"R2",C'"STNG2"')" | and split on multiple lines according to the rules like Code: | say " INCLUDE COND=("SKEY","LENGTH",CH,"R1",C'"STNG"'),AND,(" || , SKEY2","LENGTH2",CH,"R2",C'"STNG2"')" | | | Back to top | | | View previous topic :: :: View next topic | | | Similar Topics | Topic | Forum | Replies | | Calling IEHPROGM from REXX | CLIST & REXX | 7 | | REXX to send an email in Mainframe wi... | CLIST & REXX | 3 | | REXX to send an email in Mainframe | CLIST & REXX | 4 | | Best way to create an automated line ... | TSO/ISPF | 3 | | SORT - To repeat a string in same col... | SYNCSORT | 3 | | | Search our Forums: | |
0 Response to "Continuing Code on Next Line in Mplus"
Post a Comment