View previous topic :: View next topic
|
Author |
Message |
THINKSRINIII Warnings : 1 New User
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
THINKSRINIII Warnings : 1 New User
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
Need to know why it is returing that value in the next record instead of a blank value |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
how about:
SELECT
FD
I/O instructions
working-storage definition of record if using WORK-AREA option. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
rakesha.hg
Active User
Joined: 21 Mar 2008 Posts: 161 Location: bangalore
|
|
|
|
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 |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
rakesha.hg wrote: |
it got resolved when i reproduced my file ... |
You ball us out...
Quote: |
Copying the VB file to FB, then copying the FB file to VB back |
I'm eager to know what process was used to achieve this? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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
99 % of the programming questions could have been solved more quickly
by asking the guy sitting at the nearby desk |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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. . . .
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. . .
d |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
Only if the guy at the next desk had any better experience. . . . |
looks like quality and experience are going down the sink nowadays |
|
Back to top |
|
|
|