View previous topic :: View next topic |
Author |
Message |
Vijayalakshmi Beginner
Joined: 30 Apr 2004 Posts: 3 Topics: 1 Location: India
|
Posted: Tue May 04, 2004 11:49 pm Post subject: Reading VBA file in COBOL |
|
|
Hi all,
I want to read a file of Record Format VBA in COBOL program. When i try to run the program, I am getting S002 with RC=4. I want to know if this is a problem with the file. Is there any special way of handling VBA format files in the program?
Could any one please help me out in this regard? _________________ Thanks,
Vijaya. |
|
Back to top |
|
 |
Brian Beginner
Joined: 12 Aug 2003 Posts: 95 Topics: 6
|
Posted: Wed May 05, 2004 12:49 am Post subject: |
|
|
A VBA file will have a 4 byte RDW and a 1 byte carriage control.So your actual data would begin with column 6.
Cheer
Brian |
|
Back to top |
|
 |
Mervyn Moderator

Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Wed May 05, 2004 5:54 pm Post subject: |
|
|
Vijaya, Have you used the RECORD clause in your File Description entry? You probably need to use "RECORD IS VARYING...." _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
 |
Vijayalakshmi Beginner
Joined: 30 Apr 2004 Posts: 3 Topics: 1 Location: India
|
Posted: Sat May 08, 2004 4:36 am Post subject: |
|
|
I have initialized the record before READing the file. This was increasing the LRECL internally every time by 4 bytes.
When the INITIALIZE statement was removed, it worked perfect.
Could anyone tell why this 4 bytes was added to it? _________________ Thanks,
Vijaya. |
|
Back to top |
|
 |
raj051076 Beginner
Joined: 05 Dec 2002 Posts: 64 Topics: 21
|
Posted: Sat May 08, 2004 3:43 pm Post subject: |
|
|
That 4 byte is for RDW(RECORD DESCRIPTOR WORD), I think for a blocked file that should be BDW. Anyway i think that field contains the length information of the logical record.
If you would like to know the diff between physical and logical record please let me know _________________ Rajib |
|
Back to top |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Mon May 10, 2004 12:04 pm Post subject: |
|
|
Would it have worked if you had initialised only the 'data' part of the file record? That is, the record contents from 6th byte onwards. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
 |
Vijayalakshmi Beginner
Joined: 30 Apr 2004 Posts: 3 Topics: 1 Location: India
|
Posted: Tue May 11, 2004 1:55 am Post subject: |
|
|
Even if it is initialized from 6th byte, the result is the same.
After removing the INITIALIZE, each READ statement reads the content of the next line also. It is as below:
1 2...........133.......137.......255
cc 1st line .i.. 2nd line .
cc 2nd line .i.. 3rd line
cc 3rd line .i.. 4th line
The value of record length in the program is 133 and in the JCL it is 259. In the FD section, it is 255 (VBA).
Could anyone tell me what makes the difference?
Rajib,
I would be gratefule if you would provide the info about Physical and Logical record. _________________ Thanks,
Vijaya. |
|
Back to top |
|
 |
|
|