IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using dollor sign with variables


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Thu Mar 05, 2009 9:43 pm
Reply with quote

Hi,

I had a code piece in one of my program like

var3 equ *
$var1 DS ($var2-$var3)XL1

this gave me a compile problem.

Later i changed my code as

$var3 equ (*-var4)
$var1 DS ($var2-$var3)XL1

Here var4 is starting point of my working storage, with this change my code compiled correctly.

I wanted to know what is the exact significance of the dollar sign in these declarations and why exactly my first code didn't compile correctly.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Mar 05, 2009 9:49 pm
Reply with quote

f the program is Yours You should be able to tell why You decided to have variable names starting with a $


Quote:
var3 equ *
$var1 DS ($var2-$var3)XL1

this gave me a compile problem.

Later i changed my code as

$var3 equ (*-var4)
$var1 DS ($var2-$var3)XL1

Here var4 is starting point of my working storage, with this change my code compiled correctly.


Your analisys is wrong, the change that made the snippet compile correctly is that in the second case You defined $var3.
the equates equ *, equ (*-var4) are irrelevant in this case, it is the label that counts
Back to top
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Fri Mar 06, 2009 2:22 pm
Reply with quote

I checked with one of the old codes which had a similar code which i used.

So before i go ahead and use this change i wanted to know more about the usage of litral $.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Mar 06, 2009 2:32 pm
Reply with quote

did You care to look at the HLASM manuals at ( for example ) ...
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/ASMSH020
if You had, You would have found that.....
Quote:
....symbol must not consist of more than 63 alphanumeric characters. The first character must be an alphabetic character. An alphabetic character is a letter from A through Z, or from a through z, or $, _, #, or @. The other characters in the symbol may be alphabetic characters, digits, or a combination of the two.
Back to top
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Fri Mar 06, 2009 2:34 pm
Reply with quote

also when i tried with the code

$ENDWORK EQU *
*NDALLOC EQU ACCTWORK+500
$WORKREM DS ($LCLMDSPWK-$ENDWORK)XL1

it gave an error

ASMA080E STATEMENT IS UNRESOLVABLE, but it went fine with code

$ENDWORK EQU (*-ACCTWORK)
*NDALLOC EQU ACCTWORK+500 AMOUNT
$WORKREM DS ($LCLMDSPWK-$ENDWORK)XL1
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Mar 06, 2009 2:53 pm
Reply with quote

don't You get a hint that the first format was wong and the second was right
I cannot do nothing but repeat myself icon_evil.gif
did You care to look at the HLASM manuals at ( for example ) ...
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/ASMSH020
if You had, You would have found that the DS instruction is described
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ASMR1010/5.19?SHELF=ASMSH020&DT=20040728153937

RTFM
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts JCL with variables JCL & VSAM 1
No new posts JCL Variables JCL & VSAM 1
No new posts reset/clear ALL application profile v... TSO/ISPF 3
No new posts REXX - Adding variables CLIST & REXX 8
No new posts using based or defined variables PL/I & Assembler 2
Search our Forums:

Back to Top