IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem in reading a VB file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Tue May 26, 2009 12:24 pm
Reply with quote

Hi Guys,

I have a File(VB) of record length 200.Most of the records in the file have data upto 150bytes. When i try to read the content of one such record at 170th Byte, the program is trying to read data from the next record instead of returning me a blank value.
Could someone help me with this.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Tue May 26, 2009 2:56 pm
Reply with quote

Quote:
When i try to read the content of one such record at 170th Byte, the program is trying to read data from the next record instead of returning me a blank value.
How do you conclude this?
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Tue May 26, 2009 3:10 pm
Reply with quote

Need to know why it is returing that value in the next record instead of a blank value
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 26, 2009 5:00 pm
Reply with quote

how about:
SELECT
FD
I/O instructions
working-storage definition of record if using WORK-AREA option.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Tue May 26, 2009 5:00 pm
Reply with quote

You do not answer my question.

READ verd in COBOL does a sequential read, one record per read. Unless you are using reference modifications I don't happen to understand how "170th Byte" was referenced.

Please show the "code" you are using which makes this
Quote:
When i try to read the content of one such record at 170th Byte, the program is trying to read data from the next record instead of returning me a blank value.
happen. Unless you code such an instruction, program does not try anything by itself.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Tue May 26, 2009 5:15 pm
Reply with quote

In addition to what Dick asked for, also post the COBOL statement(s) you are using to do this:
Quote:
When i try to read the content of one such record at 170th Byte, the program is trying to read data from the next record instead of returning me a blank value.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue May 26, 2009 5:18 pm
Reply with quote

In your FD -

Code:
RECORD IS VARYING IN SIZE FROM "smallest-length" CHARACTERS TO "largest-length" CHARACTERS DEPENDING ON WS-INPUT-LGTH.


In WS (must be unsigned) -

Code:

03  WS-INPUT-LGTH PIC  9(08) COMP.

This was introduced with VS/COBOL II.
Back to top
View user's profile Send private message
rakesha.hg

Active User


Joined: 21 Mar 2008
Posts: 161
Location: bangalore

PostPosted: Wed May 27, 2009 9:44 am
Reply with quote

hi all,

looks like problem with the file .... i faced similar issue sometime back

it got resolved when i reproduced my file ... Copying the VB file to FB, then copying the FB file to VB back icon_lol.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Wed May 27, 2009 11:08 am
Reply with quote

rakesha.hg wrote:
it got resolved when i reproduced my file ...
You ball us out... icon_rolleyes.gif
Quote:
Copying the VB file to FB, then copying the FB file to VB back icon_lol.gif
I'm eager to know what process was used to achieve this?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed May 27, 2009 11:18 am
Reply with quote

probably by copying to a FB file of maximum length,
and back to a <pseudo(*)> VB,
(*) the file might have been defined as VB but all the records are of the same maximum length
wasting dasd space and having garbage in the unused part of the record

rant on
I wish that organizations would give proper training,
and provide code snippets to be used as samples for the most common tasks,
it seldom happens,
from the general tone of the questions in theseforums
looks like we are dealing with samples of the worst organizations around,
poor training, poor documentation, poor support,
above all poor cooperation between team members
in one concept poor management icon_cry.gif

99 % of the programming questions could have been solved more quickly
by asking the guy sitting at the nearby desk
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed May 27, 2009 9:41 pm
Reply with quote

Quote:
99 % of the programming questions could have been solved more quickly by asking the guy sitting at the nearby desk
Only if the guy at the next desk had any better experience. . . . icon_confused.gif

Time was, someone completely underqualified was a rarity in an IT office. Now there are places that have very few of even averge qualification. . . .

I also see no improvement any time soon. . . icon_sad.gif

d
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10888
Location: italy

PostPosted: Wed May 27, 2009 9:44 pm
Reply with quote

Quote:
Only if the guy at the next desk had any better experience. . . .


looks like quality and experience are going down the sink nowadays icon_sad.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts how to eliminate null indicator value... DB2 7
No new posts Reading Empty Dataset DFSORT/ICETOOL 5
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
Search our Forums:

Back to Top