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

Simple Assembler Program facing S0C1 error


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

New User


Joined: 28 Apr 2009
Posts: 89
Location: Noida , Dublin

PostPosted: Wed Jun 17, 2015 8:58 pm
Reply with quote

Hello All ,

This is the simple code I wrote to teach myself little Assembler .

All the code is doing is copying the data in variable TCH to PS Dataset .

When I am running this program job abends with S0C1 abend .

If any one can help me to point me what mistake I am doing ?

I tried to do little dump analysis of SYSUDUMP I am getting lost when PUT macro executes ( ICM instruction executes within macro ) .


Code:

       TITLE 'TEST DATASET PROGRAM'                                     
TESTDS CSECT                                                           
       SAVE (14,12)        SAVING THE STATE OF REGISTERS               
       BASR 12,0           ESTABLISH BASE ADDRESS                       
       USING *,12          ESTABLISH BASE ADDRESS                       
       ST 13,SAV1+4                                                     
       LA 13,SAV1                                                       
*PRACTISING ASSEMBLER MACROS ON DATASET                                 
       OPEN (OUTX,(OUTPUT))                                             
       PUT  OUTX,TCH                                                   
       CLOSE OUTX                                                       
OUTX   DCB DDNAME=MYOUT,DSORG=PS,MACRF=(PM),RECFM=FB,LRECL=80,         X
               BLKSIZE=80                                               
*RETURN CONTROL TO OS                                                   
       L  13,SAV1+4                                                     
       RETURN (14,12),RC=0                                             
        BR 14                                     
 *VARIABLES AND SAVEAREAS                         
                               
 TCH    DC CL80'Hello World'                               
 SAV1   DS 18F               SAVE AREA           
       
        END                                       



Please suggest .

Regards,
Manoj Jadwani
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Wed Jun 17, 2015 9:06 pm
Reply with quote

Why have you got the DCB coded within the executable code? A DCB is not executable.

Try moving it to where you have VARIABLES and SAVEAREAS defined.

Garry.
Back to top
View user's profile Send private message
mjadwani2785

New User


Joined: 28 Apr 2009
Posts: 89
Location: Noida , Dublin

PostPosted: Wed Jun 17, 2015 9:34 pm
Reply with quote

Hi Garry ,

Thanks , It really worked !!

Is it like all the constants and variables used in any assembler program should be group together and coded ?

When you say DCB is not executable ( I can also see that in DUMPS it contains all data constants ) can I find same information in manual where it says where you should code your DCB .

Sorry if I sound silly , its just I am new to Assembler and learning from all the source available on net .


Regards,
Manoj Jadwani
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 17, 2015 10:32 pm
Reply with quote

SHARE has run an Assembler Boot Camp several times during their annual conference. Google assembler boot camp for more information. There are several sessions during the week and they will give you at least a basic understanding of z/OS assembler.
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Thu Jun 18, 2015 12:05 am
Reply with quote

Code:

                                      2          PUT   ADCB,ANAREA
000000 4110 C010            00010     4+         LA    1,ADCB     
000004 4100 C010            00010     5+         LA    0,ANAREA   
000008 1FFF                           6+         SLR   15,15     
00000A BFF7 1031            00031     7+         ICM   15,7,49(1)
00000E 05EF                           8+         BALR  14,15     
The DCB is a rather large data area. Part of it is supplied by your program in the DCB macro, the remainder is filled in when you open the DCB.

LA 1,ADCB
LA 0,ANAREA

Those instruction are pretty self explanatory.

SLR 15,15
ICM 15,7,49(1)
BALR 14,15

To fully understand these instructions we must go back to history.

OS/360 was supposed to run in a system with 32K bytes of storage. Now this is hard to comprehend in a day when the desktop workstation I'm using to compose this has 6 gigabytes of storage, but in 1965/1966 32K was a BIG machine. The programmers were fighting for every byte of storage. The OS/360 PUT macro was

L 15,48(,1)
BALR 14,15

The storage byte at offset 48 in the DCB was used for something - I no longer remember what it was used for and it's not important. The 24-bit address of the code that processes a PUT request was (and still is) filled in by OPEN in bytes 49 through 51. In System/36 only the low order 24-bits of register 15 were used for the branch address in the BALR; the high order 8 bits were ignored. In the early 1980s when IBM provided for more than 16 meg of storage the old code would no longer work, so IBM changed it to SLR/ICM/BALR to make sure the higher order byte of register 15 was 0 before it executed the BALR instruction.
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 Using API Gateway from CICS program CICS 0
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top