View previous topic :: View next topic
|
Author |
Message |
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
nigelosberry
New User
Joined: 06 Jan 2009 Posts: 88 Location: Ggn, IN
|
|
|
|
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 |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
Thanks Peter.
One Question, Can't we handle specific I/O errors like we can do in COBOL using FILE-STATUS? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
vinayknj
New User
Joined: 26 May 2008 Posts: 50 Location: Bangalore
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
guess vinayknj did not want to look up SYNADAF in the manual |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
|