Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
VSAM File - VB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Itanium

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Wed Jun 03, 2009 6:14 pm    Post subject: VSAM File - VB
Reply with quote

How to declare a Variable Block VSAM file in FD Section and FILE-CONTROL Section. I have declared as below and during reads Return Code 04 is thrown.

Code:

FILE-CONTROL.
SELECT FILEA  ASSIGN TO FILEA
                      ORGANIZATION IS INDEXED   
                      ACCESS IS SEQUENTIAL       
                      RECORD KEY IS FILEA-KEY     
                      FILE STATUS FILEA-STATUS.

FILE SECTION.
FD FILEA.   
COPY FILEACPY.



Kindly let me know
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Wed Jun 03, 2009 6:27 pm    Post subject:
Reply with quote

RETURN CODE 04 or FILE STATUS 04? There is a huge difference -- RETURN CODE 04 is set by your program and we cannot tell you a thing about what it means since it will be in your code. FILE STATUS 04 means your VSAM file read a record which is not the same length as the fixed length record your FD 01 specified -- so even though the physical file is variable your COBOL program treated it as fixed length. This usually happens because you have only one fixed-length 01 under your FD, or you have multiple 01s defined but they are all the same length.
Back to top
View user's profile Send private message
Itanium

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Wed Jun 03, 2009 6:31 pm    Post subject:
Reply with quote

Thanks Robert for your quick reply.

Actually its FILE STATUS 04, and regarding the length of the file. It varies a from 36 - 20036 so we aren't able to define that much 01 under the FD.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Jun 03, 2009 6:35 pm    Post subject:
Reply with quote

Quote:
so we aren't able to define that much 01 under the FD.
No COBOL reason you couldn't, but you know your site. Try this:
Code:
FD FILEA         RECORD VARYING FROM 36 TO 20036 CHARACTERS.   
COPY FILEACPY.
YOU have to do something to tell COBOL you've got variable length records, as the default is based on the 01 level(s) under the FD, and your 01 obviously is fixed length.
Back to top
View user's profile Send private message
Itanium

Active User


Joined: 22 Jan 2006
Posts: 114
Location: India

PostPosted: Wed Jun 03, 2009 6:57 pm    Post subject:
Reply with quote

Thanks Bob. This worked icon_smile.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Jun 03, 2009 7:09 pm    Post subject:
Reply with quote

Glad to hear it worked ... but no "Bob" here ... just a Robert.
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts VSAM RLS Wait time blayek JCL & VSAM 2 Mon Oct 02, 2017 9:05 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us