filler 
Author Message
 filler

Can anyone explain to me the significance of the filler instruction,  with
an example would be nice.
Thanks in advance.


Thu, 11 Mar 2004 19:51:51 GMT  
 filler
    FILLER is not an instruction (COBOL verb) but a name sometimes used for
unreferenced data items in the DATA DIVISION or LINKAGE SECTION.  The COBOL
Language Reference Manual at www.mvshelp.com has information regarding
FILLER.  Have you looked there?

--

....Terry


Quote:
> Can anyone explain to me the significance of the filler instruction,  with
> an example would be nice.
> Thanks in advance.



Thu, 11 Mar 2004 21:19:43 GMT  
 filler
You must account for every byte in a data definition with at least a level
number(01, 05), name (NET-PAY), and a data definition (PIC X(25)). "FILLER"
allows to you avoid giving a data name to those bytes not of any interest.

For example, in a forty-byte record, you could define the record:

01  MYREC.
   02  TV-CHANNEL    PIC X(2).
   02  FILLER                 PIC X(8).
   02  TV-PROGRAM    PIC X(30).

when, for the purposes of the current program, you are indifferent to the
contents of bytes 3-10.

In more modern compilers, you can leave out the word FILLER altogether.


Quote:
> Can anyone explain to me the significance of the filler instruction,  with
> an example would be nice.
> Thanks in advance.



Fri, 12 Mar 2004 01:20:15 GMT  
 filler
a simple example can already do allot
common u guys


Quote:
>     FILLER is not an instruction (COBOL verb) but a name sometimes used
for
> unreferenced data items in the DATA DIVISION or LINKAGE SECTION.  The
COBOL
> Language Reference Manual at www.mvshelp.com has information regarding
> FILLER.  Have you looked there?

> --

> ....Terry



> > Can anyone explain to me the significance of the filler instruction,
with
> > an example would be nice.
> > Thanks in advance.



Fri, 12 Mar 2004 02:04:24 GMT  
 filler
Luc,

Jerry has already posted a good example of the use of FILLER. However, when
teaching COBOL I tell people to consider FILLER as follows:

"This is a field which I am never going to reference and can't be bothered
to think of a name for. "

As one of the old school, I still use FILLER to account for bytes in record
definitions, although it is no longer required. I believe that just having a
level number then a picture is "ugly", but that is a personal opinion and
many will feel differently.

Be aware that if you use FILLER, your code is more likely to be acceptable
across platforms (and particularly to older compilers).

SUMMARY:

Using filler will ALWAYS work.
NOT using it will work with SOME compilers.

Pete.


Quote:
> Can anyone explain to me the significance of the filler instruction,  with
> an example would be nice.
> Thanks in advance.

-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----


Fri, 12 Mar 2004 05:59:28 GMT  
 filler

Quote:
>Can anyone explain to me the significance of the filler instruction,  with
>an example would be nice.
>Thanks in advance.

FILLER is used in the DATA DIVISION to define otherwise unnamed storage.

One reason you might want to do this is when writing a report.

For example.

01  FOO-REPORT-LINE.
   03 FOO-COMPANY-CODE PIC X(02).
   03 FILLER PIC X.
   03 FOO-COMPANY-DESCRIPTION PIC X(30).
   03 FILLER PIC X(10).
   03 FOO-COMPANY-BALANCE PIC -(9)9.99.

Then, If you

initialize FOO-REPORT-LINE

move BAR-INPUT-FILE-COMPANY-CODE
  to FOO-COMPANY-CODE

move BAR-INPUT-FILE-COMPANY-DESCRIPTION
  to FOO-COMPANY-DESCRIPTION

move BAR-COMPANY-BALANCE
  to FOO-COMPANY-BALANCE

write FOO-REPORT from FOO-REPORT-LINE after advancing 1 line

You would end up with a report file which is a two character company
code followed by a space followed by company description followed by 10
spaces followed by a numeric edited value figure.

I don't know if this helps, and the example code isn't what you'd call
complete but hey. I'm on holiday and I wrote this post after a bottle of
brandy so hang me!



Fri, 12 Mar 2004 06:11:39 GMT  
 filler


Quote:

> SUMMARY:

> Using filler will ALWAYS work.
> NOT using it will work with SOME compilers.

Ture, but it is also true that

NOT using the keyword "FILLER" will *always* work in any compiler that
conforms to the '85 ANSI/ISO Standard.  If you are using a compiler that is
older than that (and some people do), then there are LOTS of "portable"
things you can't do either.

--
Bill Klein
 wmklein <at> ix.netcom.com



Fri, 12 Mar 2004 07:32:07 GMT  
 filler
The INITIALIZE will not work on FILLER - INITIALIZE FOO-REPORT-LINE
will set any field subordinate to FOO-REPORT-LINE to SPACE except those
parts with "FILLER". In the new standard draft they defined a phrase in
the INITIALIZE statement "WITH FILLER". But MOVE SPACES TO
FOO-REPORT-LINE would work on even the oldest compiler.

Another example using FILLER is when for the value of an data item is
set and tested using condition-names like

01 FILLER PIC X.
   88 g-female value "F".
   88 g-male   value "M".

you can test it with
   if g-male then ....
you can set it with
   set g-female to true
so you don't need a name when there are no other values expected.

Hope it helps
Rosa

Quote:


> >Can anyone explain to me the significance of the filler instruction,  with
> >an example would be nice.
> >Thanks in advance.

> FILLER is used in the DATA DIVISION to define otherwise unnamed storage.

> One reason you might want to do this is when writing a report.

> For example.

> 01  FOO-REPORT-LINE.
>    03 FOO-COMPANY-CODE PIC X(02).
>    03 FILLER PIC X.
>    03 FOO-COMPANY-DESCRIPTION PIC X(30).
>    03 FILLER PIC X(10).
>    03 FOO-COMPANY-BALANCE PIC -(9)9.99.

> Then, If you

> initialize FOO-REPORT-LINE

> move BAR-INPUT-FILE-COMPANY-CODE
>   to FOO-COMPANY-CODE

> move BAR-INPUT-FILE-COMPANY-DESCRIPTION
>   to FOO-COMPANY-DESCRIPTION

> move BAR-COMPANY-BALANCE
>   to FOO-COMPANY-BALANCE

> write FOO-REPORT from FOO-REPORT-LINE after advancing 1 line

> You would end up with a report file which is a two character company
> code followed by a space followed by company description followed by 10
> spaces followed by a numeric edited value figure.

> I don't know if this helps, and the example code isn't what you'd call
> complete but hey. I'm on holiday and I wrote this post after a bottle of
> brandy so hang me!



Fri, 12 Mar 2004 08:26:47 GMT  
 filler

Quote:

> FILLER is used in the DATA DIVISION to define otherwise unnamed storage.

> One reason you might want to do this is when writing a report.

> For example.

> 01  FOO-REPORT-LINE.
>    03 FOO-COMPANY-CODE PIC X(02).
>    03 FILLER PIC X.
>    03 FOO-COMPANY-DESCRIPTION PIC X(30).
>    03 FILLER PIC X(10).
>    03 FOO-COMPANY-BALANCE PIC -(9)9.99.

> Then, If you

> initialize FOO-REPORT-LINE

> move BAR-INPUT-FILE-COMPANY-CODE
>   to FOO-COMPANY-CODE

> move BAR-INPUT-FILE-COMPANY-DESCRIPTION
>   to FOO-COMPANY-DESCRIPTION

> move BAR-COMPANY-BALANCE
>   to FOO-COMPANY-BALANCE

> write FOO-REPORT from FOO-REPORT-LINE after advancing 1 line

> You would end up with a report file which is a two character company
> code followed by a space followed by company description followed by 10
> spaces followed by a numeric edited value figure.

Possibly.  This would only be true on systems where data division is
created as space filled.  In systems where the data division is
initialised as, say, null (0x00) or not initally set then the FILLERs
will be left as junk.

The INITIALISE statement that you used is actually redundant.  It won't
change the values of the FILLERs, and all the named fields have values
set into them.  It would be much more useful to replace the INITIALISE
with:

     MOVE SPACES   TO Foo-Report-Line

and then you would actually get the result you stated.



Fri, 12 Mar 2004 21:42:37 GMT  
 filler


Quote:


> > SUMMARY:

> > Using filler will ALWAYS work.
> > NOT using it will work with SOME compilers.

> Ture, but it is also true that

> NOT using the keyword "FILLER" will *always* work in any compiler that
> conforms to the '85 ANSI/ISO Standard.  If you are using a compiler that
is
> older than that (and some people do), then there are LOTS of "portable"
> things you can't do either.

Many Users neither know nor care what standard the compiler they are using
conforms to. (I'm one...<G>).

Contractors who move around different sites are much more interested in the
installation standards and ensuring that what they did at the last place is
applicable to what they may need to do at the next place (to solve the same
problem, for example).

If they compile something and it doesn't work, they don't race to find what
standard it is supposed to comply with, they reference the on site language
manual and find out what THAT particular implementation supports, in the
area where the thing has failed.

If anybody took the Standard seriously, COBOL would have died long ago...

Instead, those of us who are old hands, used to many different platforms,
vendors, and implementations, strive to develop code that will run on just
about anything, anywhere...

I didn't say "USE filler!" or "DON'T use filler!", I said:

" Using filler will ALWAYS work.
  NOT using it will work with SOME compilers."

You have agreed with me.

The fact than non-conforming compilers will have other problems when it
comes to cross-platform compatibility  is not pertinent or relevant to the
topic being discussed, which happens to be (check it out...) "FILLER" <G>.

This is ONE thing LESS to have to worry about as far as I'm concerned.

Having said that, I really don't care whether other people use FILLER or
they don't; if I was working on a site where they didn't use it, I would
code according to their preferences (that is what they pay me for..<G>).

When I'm writing code for MYSELF I code according to MY preferences, which
require the use of FILLER.

It has nothing to do with "Standard" compliance, and if you want to raise
the fact that non-compliance will cause "LOTS of "portable" things you can't
do either", then do it in another thread...this one's about FILLER. (So
there...!!<G>)

Pete.

-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----



Fri, 12 Mar 2004 19:50:34 GMT  
 filler


Quote:

> The INITIALISE statement that you used is actually redundant.  It won't
> change the values of the FILLERs, and all the named fields have values
> set into them.  It would be much more useful to replace the INITIALISE
> with:

>      MOVE SPACES   TO Foo-Report-Line

> and then you would actually get the result you stated.

Moving space to a group item containing a numeric definition 'would be more
useful' in rare cases. While this is one of these rare cases (because the
programmer immediately move a number to the defined numeric field), moving
spaces to a group item is, in general, a practice almost guaranteed to
result in problems.


Fri, 12 Mar 2004 20:29:49 GMT  
 filler


Quote:
>Can anyone explain to me the significance of the filler instruction,  with
>an example would be nice.
>Thanks in advance.

In teaching COBOL, I used the following explanation of FILLER,
which appeared to clarify its use for most:
Imagine that your going to process a file of personnel records that
contain, for each employee, values for the following fields
Employee Number,
Name,
Yearly Salary,  
Address, City,
Postal Code,
Telephone Number, ,

Admittedly, the example is contrived, but please bear with me...

Your program is going to print mailing labels.
Are there fields in the file that you do not need in order to print
mailing labels ?
Yes - Salaray is one of them.

In other words, only give access to fields that are required;
Give access on a _NEED_TO_KNOW_ basis.

In COBOL, this might be coded as such:

01 EmployeeRecord.
      05  Name                                PIC X(20).
      05  FILLER                             PIC X(8).
      05  Address                           PIC X(20).
      05  City                                     PIC X(20).
      05  Postal Code                    PIC X(6)
      05  Telephone Number      PIC X(10).

Notice that where the salary would be expected to appear, we used the
name FILLER. This means that we can't reference to characters that
represent the salary in our program. We don't need to know the salary,
so we can't access it. The digits are in there, but we can't extract
them - nor do we need to.

By the way, we also don't need the telephone numbre to address labels.
So we should have coded

      05  FILLER                              PIC X(10).

instead of
      05  Telephone Number      PIC X(10).

Robaire



Fri, 12 Mar 2004 21:41:01 GMT  
 filler

Quote:

>     MOVE SPACES   TO Foo-Report-Line

>and then you would actually get the result you stated.

Aye. This is more like what I intended.


Fri, 12 Mar 2004 23:41:56 GMT  
 filler

Quote:

> Can anyone explain to me the significance of the filler instruction,  with
> an example would be nice.
> Thanks in advance.

Luc,

The others have given you all sorts of examples using FILLERS, but here's one
that came up in a recent thread where somebody wanted to add an ISBN to an
EXISTING record.

01 MyBookRecord.
  05 BookPrimeKey    pic x(05).
  05 BookName          pic x(40).
  05 BookAuthor        pic x(20).
  05 Book etc.........
  05 Filler                    pic x(30).

Assume you didn't have the FILLER and you wanted to add an ISBN (pic x(15)) or
maybe the Book Price (pic 9(03)v9(02)) - you are stumped - you have to create
a new file record, read in the old file format and output the new file format
with these two additional fields - and INITIALIZE BOTH !.

If your record ALREADY contains the FILLER then your new record format for the
EXISTING file moves from :-

  05 Book etc.........
  05 Filler                    pic x(30).

to :-

  05 Book etc.........
  05 BookISBN                    pic x(15).
  05 BookPrice                     pic 9(03)v9(02).
  05 Filler                              pic x(10).

You should still update the new format, READ NEXT record, initialize BookISBN
and BookPrice to spaces and zeroes respectively, then REWRITE record.

I'll be perfectly honest with you -  I don't use FILLERs in this way very
often, but I think you will appreciate in a large installation with a long
history of processing, (I believe it was Skippy who just said he found an
installation still using programs written in COBOL 68 !), and where the record
format has grown to accommodate new requirements, then it becomes a godsend to
have this type of 'extra' at the end of the record to cover what may be coming
up in the future - that is, until the application gets completely revamped.

Jimmy, Calgary AB



Sat, 13 Mar 2004 00:59:24 GMT  
 filler
Another example of filler:

05  MY-SEQUENCE.
     10  My-SEQUENCE-NUMERIC   PIC X(05).
     10  FILLER                                PIC X.

...

IF MY-SEQUENCE-NUMERIC IS NUMERIC
        MOVE MY-SEQUENCE    TO VALID-SOLUTION
ELSE
        PERFORM EDIT-ROUTINE.

Reference modification works, but isn't as clear.



Sat, 13 Mar 2004 01:13:57 GMT  
 
 [ 17 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Super Field Filler Update

2. filler

3. Fillers????

4. Writing filler

5. More Fillers

6. INITIALIZE on fillers

7. Initializing a FILLER

8. INITIALIZE and FILLER question

9. seeking past end of file and filler

 

 
Powered by phpBB® Forum Software