Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Which function does the Ampersand (&) have in String

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Wed Aug 24, 2016 2:05 pm    Post subject: Which function does the Ampersand (&) have in String
Reply with quote

Hey,

I already googled a lot for it but i did not find an answer to my question. We had this MVC in our program:

Code:
MVC   MEINKEY(4),=X'50505050'
MVC   MEINKEY+4(4),SAVRABG


It produced this correct Output:

Code:
MEINKEY: &&&&0084


But for some co-worker it did not look nice enough. so he made this:

Code:
MVC   MEINKEY(4),=C'&&&&'
MVC   MEINKEY+4(4),SAVRABG


and finally Output was like that:

Code:
MEINKEY: &&  0084


So a lot of things did not work anymore because of that.

I changed it back now, but I would like to understand the meaning of this ampersand sign in strings.

Somebody here who can explain me what happened?

Best regards
Andi[/code]
Back to top
View user's profile Send private message

enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10696
Location: italy

PostPosted: Wed Aug 24, 2016 2:27 pm    Post subject: Reply to: Which function does the Ampersand (&) have in String
Reply with quote

the IBM assembler manuals will tell all You might want to know about the quirks of special chars icon_cool.gif
Back to top
View user's profile Send private message
Andi1982

New User


Joined: 27 Mar 2008
Posts: 42
Location: Karlsruhe / Germany

PostPosted: Wed Aug 24, 2016 2:34 pm    Post subject:
Reply with quote

Hey,

thank you for your hint. I found out that it is used for variables in macros.

IBM Manual - Special characters

And if you want to have the ampersand then you have to use two. So this four ones resulted in just two. If I put '&&&&&&&&' then it results in 4.

Hope my co worker will be happy with that.

Thanks again for your hint!
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 845
Location: The Universe

PostPosted: Wed Aug 24, 2016 5:43 pm    Post subject:
Reply with quote

In truth, both X'50505050' and C'&&&&&&&&' are pretty bad: X'50505050' leaves you guessing what the H is this 50?!; and &&&&&&&&, well, it's pretty obvious what the character is, but 8 & characters to produce 4 & characters is sort of weird. 4C'&&' might be a little better!

The single quote character is also strange, C'STEVE''S EXAMPLES ARE AWFUL' is sort of OK, but
Code:
MSG      DC    0CL133' ',C' I DON''T UNDERSTAND STRING '''
STRING   DC    CL8' ',CL(L'MSG-(*-MSG)''''
is a little hard to understand.

Similarly, text books always seem to use c*** like
Code:
         MVC   TOD,=X'4021207A20207A20204B2020'
         ED    TOD,TIME

TIME     DC    X'23595999'
TOD      DC    C' HH:MM:SS.SS'
That 24 character hex string is completely mysterious, but try typing it correctly! At least the TOD data area might take some of the mystery out of it.
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts how to convert Hex String t char hex Martylin PL/I & Assembler 6 Fri Jun 05, 2020 7:45 pm
No new posts How to Assign a Function key to Mainf... upendrasri TSO/ISPF 4 Sat May 30, 2020 9:03 pm
No new posts Get next 5 numeric from a string of '... maxsubrat COBOL Programming 7 Fri Apr 24, 2020 2:30 pm
No new posts Rexx STRIP Equivalent function in CLIST upendrasri CLIST & REXX 5 Mon Mar 16, 2020 9:57 pm
No new posts OUTTRAP Equivalent function in CLIST upendrasri CLIST & REXX 5 Thu Mar 12, 2020 12:12 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us