Structured Assembler Macros: The Case Statement

Here’s a simple case statement using the HLASM structured CASE macro. Register 4 is selected (your choice not = 0) and l0 is loaded into R4. The contents of the register are used to select the correct case. In this case, “Fall” is MVC-ed to the SEASON field. More complex CASE examples will be the subject of future posts.


LA R4,10
CASENTRY R4
CASE 12,1,2
MVC SEASON,=CL6’WINTER’
CASE 3,4,5
MVC SEASON,=CL6’SPRING’
CASE 6,7,8
MVC SEASON,=CL6’SUMMER’
CASE 9,10,11
MVC SEASON,=CL6’FALL’
ENDCASE
PUT FILEOUT,RECOUT

Leave a comment

Filed under IBM Mainframe Assembler

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s