Check the sysout for the step as well, you may have some messages there (always worth checking).Hi, I am trying to Key read a VSAM File that is in a Variable Block Format.Please Help File Length: 4500 to 32752 Select all SELECT FILE 1 ASSIGN TO FILE1 ORGANIZATION IS INDEXED ACCESS MODE IS DYNAMIC RECORD KEY IS FILE1-KEY FILE STATUS IS FILE1-STATUS.
FD FILE1. RECORD IS VARYING FROM 4500 TO 32752 DEPENDING ON W-REC-SIZE. FILE1-RECORD. 05 FILE1-KEY PIC X(26). FILLER PIC X(32726). ![]() A file status 39 means that your COBOL program does not have the file defined in the same way that the file exists on the disk. As such, what you have posted is less than half the information needed to help you. Also needed an IDCAMS LISTCAT of the file, and the data map showing what COBOL knows about the file. But the file is defined as follows: Type: KSDS KEYLEN: 26 AVGLRECL: 4500 MAXLRECL: 32752 Can you tell me what other info that you need from the LISTCAT. Things that need to be looked at include whether or not the file has an alternate index -- if so, this must be described to COBOL. Plus, the LISTCAT shows the ACTUAL file attributes, not just what you say they are. People have been known to misunderstand how a file is defined, so the LISTCAT allows the file attributes as the system knows them to be shown. Note that IS VARYING specifies the minimum to maximum length, yet you have specified the average record length. If using a VSAM file, you have an extended file status available, so it is good to always include that (contents contain details of what VSAM has to say about the last IO operation). Hi, Robert: I cannot paste the whole listcat of the file here due to access reasons. From what I see it is defined as a regular KSDS file in a Variable Block format. Billy How do you get the extended file status Im sorry i know its a very basic question but I can only get the error code 39. Anyway, regarding your first statement, youre right it shouldnt cause an error at opening but yet it did. I really tried everything that I know but somehow there is still an error between the file definition and the cobol program. Im guessing maybe im accessing it as DYNAMIC Is there a limitation for Variable Block files accessed as DYNAMIC in Cobol The sample codes that I have seen in Google is Variable Block files are accessed Sequentially. If you cannot provide objective indications of how the file is defined to the system, theres not going to be much we can do to help you. And you never have posted the Data Division Map from the COBOL compile showing your file. It is a VSAM file. ![]() VSAM has Control Intervals, which contain records (or data or index records) and Control Areas which contain Control Intervals. You will see from the Data Map what Cobol thinks the file is, and from the LISTCAT what the file actually is. You also need to ensure that you have the same dataset name on the DD statement in the JCL as that which you produce the LISTCAT for.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |