IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Getting error while opening a variable block file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
apandey1

New User


Joined: 29 Sep 2008
Posts: 2
Location: Mumbai

PostPosted: Fri May 05, 2017 12:22 pm
Reply with quote

Hi
I have declared a variable block file into my prog.
FD UNIA-AGENT-IP-FILE
RECORDING MODE IS V
BLOCK CONTAINS 0 RECORDS
RECORD IS VARYING FROM 1 TO 990
DEPENDING ON WS-COUNT-REC.

01 UNIA-AGENT-IP-REC PIC X(990).

Largest record length of my input file is 994, so in FD iI gave 990 bytes, now while opening this input file, I am getting below file status code in sysout

ENTERING MODULE
UIXXU00 - MSG0101 OPEN ERROR ON AGENTINP INPUT FILE - FILE STATUS CODE = 9)
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 05, 2017 3:53 pm
Reply with quote

Are you sure you're running on a mainframe? Enterprise COBOL file status codes are 2 digits, so if you are running on a mainframe you are missing the VITAL second digit of the file status code.
Back to top
View user's profile Send private message
apandey1

New User


Joined: 29 Sep 2008
Posts: 2
Location: Mumbai

PostPosted: Fri May 05, 2017 4:32 pm
Reply with quote

running the program in MFED(microfocus enterprise developer),
but compiler directives are set to Z/OS, microsoft enterprise cobol.
not to MF Cobol.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 316
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri May 05, 2017 4:39 pm
Reply with quote

Quote:
Largest record length of my input file is 994, so in FD iI gave 990 bytes, now while opening this input file, I am getting below file status code in sysout.

What do you mean? The LRECL(in JCL) of your VB dataset is 994 or the maximum record length of any record in the VB dataset could be 994? In later case your VB dataset LRECL(in JCL) will be 998 and in COBOL program you should use 994.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri May 05, 2017 4:59 pm
Reply with quote

Quote:
running the program in MFED(microfocus enterprise developer),
but compiler directives are set to Z/OS, microsoft enterprise cobol.
not to MF Cobol.
In that case, look up the file status code in the MFED manual. There is nothing we can do to help you when you come to us with non-mainframe products. And an Enterprise COBOL file status code would be 90 through 99, NOT "9". The fact that you're getting non-Enterprise COBOL file status codes out means that even though compiler directives are set to z/OS means that the compiler does NOT replicate the mainframe environment.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat May 06, 2017 12:09 am
Reply with quote

Also, you should be able to check your compiler output to see what the file is listed as -- depending upon how you code your program, it is not uncommon for COBOL to consider a variable length file to be fixed length, which would cause a non-zero file status code when you open the file (most likely a 39 but if the data set is VSAM it could be 92).
Code:
Source   Hierarchy and                                    Base      Displacement  Asmblr Data                      Data Def     
LineID   Data Name                                        Locator     Structure   Definition        Data Type      Attributes   
     2  PROGRAM-ID MF0022------------------------------------------------------------------------------------------------------*
    31   FD VSAM-FILE . . . . . . . . . . . . . . . . . . BLF=00001                                 VSAM           F             
    32   1  VSAM-RECORD . . . . . . . . . . . . . . . . . BLF=00001               DS 0CL1000        Group                       
This Enterprise COBOL output extract shows a fixed length VSAM data set. For a variable length VSAM data set, the F under Data Def Attributes would be a V.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Error when install DB2 DB2 2
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top