Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Simple Assembler Program facing S0C1 error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Simple Assembler Program facing S0C1 error
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Jun 17, 2015 9:06 pm    Post subject:
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    Post subject:
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: 7914
Location: Bellevue, IA

PostPosted: Wed Jun 17, 2015 10:32 pm    Post subject:
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 User


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

PostPosted: Thu Jun 18, 2015 12:05 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us