| View previous topic :: View next topic |
| Author |
Message |
k_sharma Beginner
Joined: 14 Aug 2003 Posts: 10 Topics: 3 Location: Dallas, US
|
Posted: Thu Aug 14, 2003 2:07 am Post subject: Synad and put in Assembler |
|
|
I am using a Sequential file for OUTPUT in assembler code. For this I am using PUT to write data to output. But after using PUT how can I check the return code whether PUT was successful or not.
Somewhere I heard that we can use
LTR r15,r15. If r15 is zero it will be ok. But when I debuged the program it is giving some address in R15 and also PUT is successful. I don't know whether we can use R15 or not.
There is also one option SYNAD in DCB for error routines. Can anybody tell me how we can check the return code after PUT. |
|
| Back to top |
|
 |
chaoslord Beginner
Joined: 20 Aug 2003 Posts: 2 Topics: 0
|
Posted: Wed Aug 20, 2003 3:00 pm Post subject: |
|
|
Hi k_sharma,
I don't know, if the SYNAD disturbs the normal error-checking,
but I do it always that style :
To check a PUT Statement on errors do the following :
| Code: |
OPEN OUTPUT
...
LOOP001 DS 0H
GET INPUT,INREC
...
DO-PROCESSING-TILL-IT's-DONE
...
PUT OUTPUT,OUTREC
LTR 15,15
BNZ ERROR
B LOOP001
EOFINP DS 0H
...
OUTPUT DCB MACRF=PM,DDNAME=OUTPUT,RECFM=FB,LRECL=80
|
_________________ Azzembler RuleZ ! |
|
| Back to top |
|
 |
DaveyC Moderator

Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Thu Aug 21, 2003 8:09 am Post subject: |
|
|
Testing R15 after a put is useless. To be honest, I wouldn't worry about it too much. If the put is in error your program will abend. You could write a SYNAD exit, but I never bother. _________________ Dave Crayford |
|
| Back to top |
|
 |
|
|
|