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
 

 

FILE STATUS Code check in Assembler

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

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Wed May 18, 2011 1:06 pm    Post subject: FILE STATUS Code check in Assembler
Reply with quote

Hi,

I am writing some data into a file using PUT statement.
Code:

OPEN (OUTFLE,(OUTPUT))
LTR R15,R15
BNZ BADOPEN
DISMSG2 WTO 'OPEN OUTPUT FILE SUCCESS'
PUT OUTFLE,OUTREC
LTR R15,R15
BNZ BADPUT
DISMSG3 WTO 'WRITE OUTPUT FILE SUCCESS'

OUTFLE DCB DSORG=PS, +
MACRF=(PM), +
DDNAME=OUTFILE, +
LRECL=80, +
RECFM=FB, +
BLKSIZE=8000

The OPEN statement is success since the WTO message is displayed in SPOOL, But after the PUT statement, control is going to BADPUT Label.

Please tell me what is wrong with the PUT Statement?

JCL file declaration

//OUTFILE DD DSN=ISPF.V06530.TEST.FILE1,
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
// UNIT=TEST,
// SPACE=(CYL,(10,20),RLSE)
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Wed May 18, 2011 1:18 pm    Post subject:
Reply with quote

Get and PUT dont return a return code in R15. In case of an error the DCB SYNAD routine wil get control if it exists.
Back to top
View user's profile Send private message
nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Wed May 18, 2011 1:37 pm    Post subject: Re: FILE STATUS Code check in Assembler
Reply with quote

Hi Vinay,

I think the program you are writing is a sample/test program. there's no harm in copy-pasting the whole program here.

While writing program code in your posts next time, please use the tag-button "Code". This will display your program code on black background with fixed sized fonts. The code section will thus be more readable.


About your query:
dont go on the content of R15.
(i)Check the content of your file after the job is executed.
(ii)make sure you close the file before exiting from program.
(iii)have a look at your jessysmsg and see if there is any ready-made system generated message. If one is there it will help you recognise the possible problem.
Back to top
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Wed May 18, 2011 3:20 pm    Post subject: FILE STATUS Code check in Assembler
Reply with quote

Hi Nihal/Peter,

Thanks for the information.

So the GET and PUT statements will not put the status code in R15?
The file is being created and also data is being written actually. So I shouldn't check for R15 for successfull execution of OPEN,GET or PUT statements? Please Confirm.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Wed May 18, 2011 3:27 pm    Post subject:
Reply with quote

The OPEN can be tested on R15, for the GET/PUT you have to supply a SYNAD routine if you want to handle errors yourself. If not supplied the OS will terminate your program abnormally.

You can find it all here :

DFSMS Macro Instructions for Data Sets
Back to top
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Wed May 18, 2011 3:32 pm    Post subject: FILE STATUS Code check in Assembler
Reply with quote

Thanks Peter.

One Question, Can't we handle specific I/O errors like we can do in COBOL using FILE-STATUS?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Wed May 18, 2011 3:37 pm    Post subject:
Reply with quote

vinayknj,

are you a little slow?
Quote:

for the GET/PUT you have to supply a SYNAD routine if you want to handle errors yourself
Back to top
View user's profile Send private message
vinayknj

New User


Joined: 26 May 2008
Posts: 50
Location: Bangalore

PostPosted: Wed May 18, 2011 4:12 pm    Post subject: FILE STATUS Code check in Assembler
Reply with quote

I got it that by coding a label for SYNAD in DCB we can handle I/O errors but can we identify wat error has occurred by looking at some status field like we do in COBOL using FILE-STATUS?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Wed May 18, 2011 4:29 pm    Post subject:
Reply with quote

Before you are asking things over and over read the fine manuals :

DFSMS Using Data Sets
DFSMS Macro Instructions for Data Sets

or stop using assembler.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8033
Location: East Dubuque, Illinois, USA

PostPosted: Wed May 18, 2011 4:32 pm    Post subject:
Reply with quote

vinayknj:

1. Assembler is not COBOL.
2. COBOL is not Assembler
3. If you want file status codes, you need to use COBOL not Assembler
4. If you want to code in Assembler, learn to use the Assembler tools -- not wish for things from other languages.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu May 19, 2011 1:33 pm    Post subject:
Reply with quote

guess vinayknj did not want to look up SYNADAF in the manual
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Thu May 19, 2011 2:08 pm    Post subject:
Reply with quote

dbzTHEdinosauer wrote:
guess vinayknj did not want to look up SYNADAF in the manual


If the TS should have read any of the manuals i proposed (especially the part about the SYNAD exit) he should have stumbled over SYNADAF. But then the TS wants the answers to be repeated / explained over and over
again. I dont have the power anymore to do that again.
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 Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Length of Tape file Mohan Kothakota JCL & VSAM 9 Thu Apr 20, 2017 10:24 pm
No new posts Need help in reading and validating a... ABINAYATHULASI COBOL Programming 8 Tue Apr 18, 2017 11:42 am
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am


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