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
 
Problem in reading a VB file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Problem in reading a VB file
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

Senior Member


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

PostPosted: Tue May 26, 2009 2:56 pm    Post subject:
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    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Tue May 26, 2009 5:00 pm    Post subject:
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

Senior Member


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

PostPosted: Tue May 26, 2009 5:00 pm    Post subject:
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: 8201
Location: Dubuque, Iowa, USA

PostPosted: Tue May 26, 2009 5:15 pm    Post subject:
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: 2504
Location: Atlanta, Georgia, USA

PostPosted: Tue May 26, 2009 5:18 pm    Post subject: Reply to: Problem in reading a VB file
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    Post subject: Reply to: Problem in reading a VB file
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

Senior Member


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

PostPosted: Wed May 27, 2009 11:08 am    Post subject: Re: Reply to: Problem in reading a VB file
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10375
Location: italy

PostPosted: Wed May 27, 2009 11:18 am    Post subject: Reply to: Problem in reading a VB file
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

Site Director


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

PostPosted: Wed May 27, 2009 9:41 pm    Post subject: Reply to: Problem in reading a VB file
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10375
Location: italy

PostPosted: Wed May 27, 2009 9:44 pm    Post subject: Reply to: Problem in reading a VB file
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    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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

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