Page 1 of 1

insert symbol

PostPosted: Tue Sep 18, 2012 6:15 pm
by blackswan
Hello All,

I have a query.

I have a variable declared as:

W_A DC CL5'ABC'

How can i print this variable as using assembler prog:

'ABC' (with quotes) instead of ABC.

I am confused how can i insert the symbol (hex code 27).

please guide me.

Re: insert symbol

PostPosted: Tue Sep 18, 2012 6:48 pm
by Robert Sample
Your first, and probably biggest problem, is that mainframes use EBCDIC, not ASCII. The quote mark is X'7D', NOT X'27', in EBCDIC.

Try this:
         DC    CL1''''
since pairs of quote (tic) marks are replaced by single ones inside quote (tic) marks.

Re: insert symbol

PostPosted: Tue Sep 18, 2012 6:58 pm
by blackswan
hello robert,

i used as :

000082                               54 D       DC        CL4''ABC''     
** ASMA074E Illegal syntax in expression - 'ABC''                       



and getting error.

Re: insert symbol

PostPosted: Tue Sep 18, 2012 7:00 pm
by BillyBoyo
Try with three, as Robert has indicated. You need '' to get your one, and one more to have it bounded by the quotes/ticks.

Re: insert symbol

PostPosted: Tue Sep 18, 2012 7:14 pm
by Robert Sample
Notice the error message indicates what I told you -- there is an opening quote (tic) mark, then you need two to become a single one; since you only put one the error message shows a single tic followed by the rest of your text.

Re: insert symbol

PostPosted: Wed Sep 19, 2012 5:08 pm
by steve-myers
Billyboyo and Mr. Sample are correct. I've been doing Assembler for more than 40 years, and I still have to think about it! CLI X,C'''' for example. C' starts the character constant, '' creates a single quote, and then ' to terminate the character constant. It woulld be clearer if I used code tags:
CLI X,C'''' C' to start the character constant, '' for the quote, and ' to end