View previous topic :: View next topic
|
Author |
Message |
jar_tar
New User
Joined: 08 Oct 2008 Posts: 2 Location: Turkey
|
|
|
|
How can I check all files' status which are assign to a single job dd card ?
If I have a two or more file in my JCL dd card and the second file have some errors, I cant handle error by checking file status code, in this case
file status code is always return as 0. When i chage order of files, erroneous file become first and i can handle error of file.
Please see that below.
JCL Code:
Code: |
....
//FMWORK DD DSN=TYTR.F010PSN.TYTRGY10,DISP=OLD
// DD DSN=TREP.F010PSN.REPMUH74,DISP=OLD
....
|
Cobol Code:
Code: |
....
OPEN INPUT WORK.
IF FMWORK-STAT NOT =
DISPLAY 'ERROR'
END-IF.
....
|
|
|
Back to top |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
To be able to check file status you have to suppply File Status WS-varname ( a Pic XX variable) in your Select for the file.
You dont have to worry about if you have 1 or more files concatenated in yor JCL.
Pls supply your COBOL-code for your Select and the code where you check, otherwise its difficult to help you in this matter. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
How can I check all files' status which are assign to a single job dd card ? |
You completely and totally misunderstand file status in COBOL. A file status is set based on a "file" -- which can be one data set assigned to a DD statement, or two data sets concatenated to a DD statement, or 37 data sets concatenated to a DD statement, or .... When the open is done, and the first data set for the DD statement opens without issue, then you'll typically get a 00 file status for the open. You need to check the file status not just for the open, but for every read as well -- especially if there's a chance you've got problems with concatenated data sets. |
|
Back to top |
|
|
jar_tar
New User
Joined: 08 Oct 2008 Posts: 2 Location: Turkey
|
|
|
|
Robert Sample wrote: |
Quote: |
How can I check all files' status which are assign to a single job dd card ? |
You completely and totally misunderstand file status in COBOL. A file status is set based on a "file" -- which can be one data set assigned to a DD statement, or two data sets concatenated to a DD statement, or 37 data sets concatenated to a DD statement, or .... When the open is done, and the first data set for the DD statement opens without issue, then you'll typically get a 00 file status for the open. You need to check the file status not just for the open, but for every read as well -- especially if there's a chance you've got problems with concatenated data sets. |
Thank you, this was very helpful. As you said i didnt got wat does file status really means. |
|
Back to top |
|
|
|