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
 

 

Getting error while opening a variable block file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Getting error while opening a variable block file
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri May 05, 2017 3:53 pm    Post subject:
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    Post subject: Reply to: Getting error while opening a variable block file
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: 283
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Fri May 05, 2017 4:39 pm    Post subject:
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri May 05, 2017 4:59 pm    Post subject:
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Sat May 06, 2017 12:09 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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