MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reading VBA file in COBOL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Vijayalakshmi
Beginner


Joined: 30 Apr 2004
Posts: 3
Topics: 1
Location: India

PostPosted: Tue May 04, 2004 11:49 pm    Post subject: Reading VBA file in COBOL Reply with quote

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
View user's profile Send private message
Brian
Beginner


Joined: 12 Aug 2003
Posts: 95
Topics: 6

PostPosted: Wed May 05, 2004 12:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Wed May 05, 2004 5:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vijayalakshmi
Beginner


Joined: 30 Apr 2004
Posts: 3
Topics: 1
Location: India

PostPosted: Sat May 08, 2004 4:36 am    Post subject: Reply with quote

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
View user's profile Send private message
raj051076
Beginner


Joined: 05 Dec 2002
Posts: 64
Topics: 21

PostPosted: Sat May 08, 2004 3:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Mon May 10, 2004 12:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vijayalakshmi
Beginner


Joined: 30 Apr 2004
Posts: 3
Topics: 1
Location: India

PostPosted: Tue May 11, 2004 1:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group