Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SOC1 ABEND with Assembler Code.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
satish.ms10

Active User


Joined: 10 Aug 2009
Posts: 161
Location: India

PostPosted: Fri Sep 17, 2010 5:20 pm    Post subject: SOC1 ABEND with Assembler Code.
Reply with quote

Hi,

I have written a sample ASM program to read from a file and write the record into output file. It got compiled successfully but it is giving SOC1 abend at the time of execution.

Here is the code:
Code:

         PRINT NOGEN                                                   
         START 0                                                       
HELLO    CSECT                                                         
         USING *,12                                                   
         STM   14,12,12(13)                                           
         LR    12,15                                                   
         LA    15,SAVE                                                 
         ST    15,8(13)                                               
         ST    13,4(15)                                               
         LR    13,15                                                   
*                                                                     
         OPEN  (FILEA,INPUT)                                           
         OPEN  (FILEB,OUTPUT)                                         
LOOP     GET   FILEA,IREC                                             
         MVC   OTID,ITID                                               
         MVC   OTNAME,ITNAME                                           
         MVC   OTDEG,ITDEG                                             
         PUT   FILEB,OREC                                             
         B     LOOP                                                   
ATEND    CLOSE FILEA                                                   
         CLOSE FILEB                                                   
         RETURN                                                       
*                                                                     
         LTORG                                                         
*                                                                     
FILEA    DCB   DSORG=PS,MACRF=GM,EODAD=ATEND,DDNAME=FILEA             
FILEB    DCB   DSORG=PS,MACRF=PM,DDNAME=FILEB                         
*                                                                     
IREC     DS    0CL80                                                   
ITID     DS    CL5                                                     
ITNAME   DS    CL25                                                   
ITDEG    DS    CL15                                                   
         DS    CL35                                                   
*                                                                     
OREC     DS    0CL60                                                   
OTID     DS    CL5                                                     
         DC    CL3' '                                                 
OTNAME   DS    CL25                                                   
         DC    CL3' '                                                 
OTDEG    DS    CL15                                                   
         DC    CL9' '                                                 
*                                                                     
SAVE     DS    18A                                                     
         END   HELLO                                                   
                                                                       


Kindly let me know that Is this code correct?

Please let me know what are all other statements need to code.

Thanks you very much.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8620
Location: Back in jolly old England

PostPosted: Fri Sep 17, 2010 5:29 pm    Post subject:
Reply with quote

Psychic day was Tuesday this week.

How many times do we have to reply to people and ask them for the

OUTPUT

of the failed run and showing exactly what has happened.

Or do you expect someone to copy, assemble and link the code and try it for themselves.
Please have a think about providing usefull information before posting will you !!!
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Fri Sep 17, 2010 6:07 pm    Post subject: Reply to: SOC1 ABEND with Assembler Code.
Reply with quote

At the very least, your program must be Assembled/Linked as AMODE/RMODE 24, because you're using DCB's.

After the CLOSE of both files, you're not restoring the caller's R13 from the 18-word savearea (L 13,4(,13)). Also, the RETURN Macro is incomplete, as it needs to specify RETURN (14,12),RC=(15). It's always a good idea (and it can't hurt) to set R15 to a value (such as F'0') and return it to the Caller. If the Caller is COBOL, then this would be the RETURN-CODE Special-Register. I think PL/I's counterpart is PLIRETC, but I'm not 100% certain.

I would advise you to use R3 instead of R12 as the base-register, because if the caller is Language Environment compliant, R12 always contains the address of the CEECAA and if you ever change the sub-program to be LE compliant, you'll need this address.

The ABEND information in SYSOUT should give you the address in the sub-program that caused the S0C1 (an invalid OP CODE), which is easy enough to find in the listing.

What could be happening is after the RETURN (which needs to be fixed), execution falls through and hits a DS/DC expansion in the DCB because an LTORG should not be generated (don't see any literals).

This is a sub-program, correct?

Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Fri Sep 17, 2010 6:08 pm    Post subject:
Reply with quote

Compiled with no errors only means: proper syntax was followed.

has nothing to do with logic or functional correctness of interrelated instructions.

saying that your program
Compiled with no errors
is telling us that you know little or nothing about computers.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Fri Sep 17, 2010 8:08 pm    Post subject: Reply to: SOC1 ABEND with Assembler Code.
Reply with quote

Quote:
I have written a sample ASM program to read from a file and write the record into output file. It got compiled successfully but it is giving SOC1 abend at the time of execution.

Unlike HLL's, who will inform you about potential errors, the Assembler is unforgiving and it assumes that you know what you're doing.

BTW, you Assemble an Assembler program, whereas, you Compile a COBOL program.

Bill
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 IBEGENER RETURN CODE 12 anilkumar922 All Other Mainframe Topics 5 Wed Dec 13, 2017 11:41 am
No new posts Finding the plan when code compiled u... Ahemad DB2 1 Fri Dec 01, 2017 6:38 pm
No new posts Strange Code amitc23 COBOL Programming 6 Tue Nov 28, 2017 11:25 am
No new posts ASP3 ABEND IN CICS Vedant CICS 0 Fri Oct 20, 2017 3:18 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us