insert symbol



High Level Assembler(HLASM) for MVS & VM & VSE

insert symbol

Postby blackswan » Tue Sep 18, 2012 6:15 pm

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.
blackswan
 
Posts: 13
Joined: Thu Sep 13, 2012 2:39 pm
Has thanked: 0 time
Been thanked: 1 time

Re: insert symbol

Postby Robert Sample » Tue Sep 18, 2012 6:48 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: insert symbol

Postby blackswan » Tue Sep 18, 2012 6:58 pm

hello robert,

i used as :

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



and getting error.
blackswan
 
Posts: 13
Joined: Thu Sep 13, 2012 2:39 pm
Has thanked: 0 time
Been thanked: 1 time

Re: insert symbol

Postby BillyBoyo » Tue Sep 18, 2012 7:00 pm

Try with three, as Robert has indicated. You need '' to get your one, and one more to have it bounded by the quotes/ticks.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: insert symbol

Postby Robert Sample » Tue Sep 18, 2012 7:14 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: insert symbol

Postby steve-myers » Wed Sep 19, 2012 5:08 pm

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
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to Assembler