For Programmers: Free Programming Magazines  


Home > Archive > Cobol > June 2005 > What is the difference between "VALUE SPACES" and "VALUE ALL SPACES&qu









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author What is the difference between "VALUE SPACES" and "VALUE ALL SPACES&qu
dibalok@gmail.com

2005-06-11, 8:55 am

Hi,
I have declared some WS variables and a filler in a COBOL program. I
have initialised the filler as "VALUE SPACES". The problem is when i am
writing those WS Variables & the filler into a output file, i am
getting NULL in the filler.But when i am initialising the filler with
"VALUE ALL SPACES", Spaces are coming in the output file.
All i want to know, whether there is any difference between "VALUE
SPACES" and "VALUE ALL SPACES". If there are no differences then what
might be the possible cause for NULL values that are coming in the
filler.

Regards,
Dib

SkippyPB

2005-06-11, 3:55 pm

On 11 Jun 2005 01:01:36 -0700, dibalok@gmail.com enlightened us:

>Hi,
>I have declared some WS variables and a filler in a COBOL program. I
>have initialised the filler as "VALUE SPACES". The problem is when i am
>writing those WS Variables & the filler into a output file, i am
>getting NULL in the filler.But when i am initialising the filler with
>"VALUE ALL SPACES", Spaces are coming in the output file.
>All i want to know, whether there is any difference between "VALUE
>SPACES" and "VALUE ALL SPACES". If there are no differences then what
>might be the possible cause for NULL values that are coming in the
>filler.
>
>Regards,
>Dib


For os390 mainframe Cobol (all versions that I know of), there is no
difference between a working storage definition of VALUE SPACES and
VALUE ALL SPACES. That is, if you have a field defined as FILLER PIC
X(20) VALUE SPACES, you'll get a field of 20 spaces. Same thing if
you say VALUE ALL SPACES or VALUE SPACE.

First, what is the hex value you are seeing for the NULLS? If it is
X'00', then look in your code for a move that might be moving LOW
VALUES to the group level name of the data description containing the
FILLER field.

Regards,

////
(o o)
-oOO--(_)--OOo-


"I had a nightmare last night. I dreamed Dolly Parton
was my mother and I was a bottle-baby."
--Henry Youngman
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Remove nospam to email me.

Steve
William M. Klein

2005-06-11, 3:55 pm

In any standard-conforming compiler, there is never a difference between
"spaces" and "all spaces" (both are "figurative constant" syntax).

Therefore, if you have an initial VALUE clause, with VALUE SPACES (in
Working-Storage *not* File Section), then nothing should be placing nulls
(low-value) in the filler items.

My best guess (without seeing your entire code) is that you are:

A) using a VALUE clause in WS
B) you "fill in" the non-Filler fields under the group item
C) you then MOVE the individual (filled-in) items to a record under your FD
D) write the file out

In this case, you are never "moving" the filler fields from WS to the file
(before writing).

The other possibility is that you have a VALUE SPACES phrase under an FD -
rather than WS. In this case, many compilers (not the Standard) allow you to do
this - as an extension BUT the VALUE clause is ignored (and will never cause
spaces to be in the filler items).

There are probably several other possible causes of the symptom you are seeing.
If you have an interactive debugger, I would use it - and "watch" the values in
your filler items and see when they change from an initial spaces to nulls.

--
Bill Klein
wmklein <at> ix.netcom.com
<dibalok@gmail.com> wrote in message
news:1118476896.252649.244650@z14g2000cwz.googlegroups.com...
> Hi,
> I have declared some WS variables and a filler in a COBOL program. I
> have initialised the filler as "VALUE SPACES". The problem is when i am
> writing those WS Variables & the filler into a output file, i am
> getting NULL in the filler.But when i am initialising the filler with
> "VALUE ALL SPACES", Spaces are coming in the output file.
> All i want to know, whether there is any difference between "VALUE
> SPACES" and "VALUE ALL SPACES". If there are no differences then what
> might be the possible cause for NULL values that are coming in the
> filler.
>
> Regards,
> Dib
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com