View previous topic :: View next topic
|
Author |
Message |
daks
New User
Joined: 13 Sep 2007 Posts: 3 Location: INDIA
|
|
|
|
Could anyobdy expalin me the user of FILLER
01 FILLER PIC X(9). |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
user of filer? or Uses of filler?
Did you face any interview question like that?
FILLER can be used to align numeric variables to word boundaries for performance improvement.
When you intialize a group variable, filler fields are unaffected. This can be used to our advantage. for example in date fields-
Code: |
01 date-fl.
05 mm pic xx.
05 filler pic x value '/'.
05 dd pic xx.
05 filler pic x value '/'.
05 yy pic xx. |
By declaring this variable we need not move '/' as a separator even if we use and initialize date-fl in program many times. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
daks,
Generally FILLER is used for creating SLACK BYTES. |
|
Back to top |
|
|
daks
New User
Joined: 13 Sep 2007 Posts: 3 Location: INDIA
|
|
|
|
thanks for reply...
but i got a code where FILLER used in the following way..
i cant understand this...
please help me out?
WS-ORD-DATE PIC 9(08) VALUE ZEROES.
FILLER REDEFINES WS-ORD-DATE.
10 WS-ORD-DATE-CC PIC 9(02).
10 WS-ORD-DATE-FMT PIC 9(06).
10 FILLER REDEFINES WS-ORD-DATE-FMT.
15 WS-ORD-DATE-YY PIC 9(02).
15 WS-ORD-DATE-MM PIC 9(02).
15 WS-ORD-DATE-DD PIC 9(02). |
|
Back to top |
|
|
chiranjeevi_mca
New User
Joined: 19 Feb 2006 Posts: 27
|
|
|
|
Hi
Filler is the purpose of declaring the variable with out specify any name.
Ex:
01 Todays-Date
02 Todays-CCYY Pic X(4)
02 Filler Pic X(1) Value '/'
02 Todays-MM Pic x(2)
02 Filler Pic X(1) Value '/'
02 Todays-DD Pic x(2)
move '2007' to Todays-CCYY
move '09' to Todays-MM
move '14' to Todays-DD
Display Todays-Date
It display's '2007/09/14'. It occupies the size of 10 bytes.
In Your Example:
WS-ORD-DATE is the Numeric Variable and size is 8 bytes.
FILLER REDEFINES WS-ORD-DATE means :
The Programmer using the same memory of WS-ORD-DATE and the expanded dataitems for filler will use to change the values.
10 WS-ORD-DATE-CC PIC 9(02).
10 WS-ORD-DATE-FMT PIC 9(06).
10 FILLER REDEFINES WS-ORD-DATE-FMT.
15 WS-ORD-DATE-YY PIC 9(02).
Ex: If the value of WS-ORD-DATE is '20070914'
Then If you want to display the Century
Display WS-ORD-DATE-CC. It display's 20
Display WS-ORD-DATE-YY . It display's 07
Like that it will be useful
Regards,
Chiranjeevi. |
|
Back to top |
|
|
daks
New User
Joined: 13 Sep 2007 Posts: 3 Location: INDIA
|
|
|
|
its ok now.....
thanks chiranjeevi................ |
|
Back to top |
|
|
dr_te_z
New User
Joined: 08 Jun 2007 Posts: 71 Location: Zoetermeer, the Netherlands
|
|
|
|
daks wrote: |
01 FILLER PIC X(9). |
Bad example. Filler is never used at 01 or 77 levels. |
|
Back to top |
|
|
ulfnsc
New User
Joined: 15 Jan 2004 Posts: 19 Location: Stockholm, SWEDEN
|
|
|
|
Never say never...
I have seen it in many programs....
Uffe |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
77 levels might be hard to justify as FILLER, but 01 are quite often FILLER (usually without the VALUE).... |
|
Back to top |
|
|
lcmontanez
New User
Joined: 19 Jun 2007 Posts: 50 Location: Chicago
|
|
|
|
FYI, you don't need to code filler with the latest cobol compiler in some situations
01 Pic X will work. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
but 01 are quite often FILLER |
This is quite common with the FILLER redefines another 01 but doesn't need a name. . . |
|
Back to top |
|
|
dr_te_z
New User
Joined: 08 Jun 2007 Posts: 71 Location: Zoetermeer, the Netherlands
|
|
|
|
CICS Guy wrote: |
but 01 are quite often FILLER (usually without the VALUE).... |
You've done it. You made me curious. Can you give some sample code how to use a "01 filler" definition? |
|
Back to top |
|
|
ulfnsc
New User
Joined: 15 Jan 2004 Posts: 19 Location: Stockholm, SWEDEN
|
|
|
|
Code: |
013400 WORKING-STORAGE SECTION.
013500 77 FILLER PIC X(32) VALUE
013600 'WWWWWWWWWW LU001 WWWWWWWWWWWWW'.
|
and
Code: |
016100 01 DATUM PIC 9(8).
016200 01 FILLER REDEFINES DATUM.
016300 05 DATUM-SS PIC 99.
016400 05 DATUM-AA PIC 99.
016500 05 FILLER PIC 9(4).
016600 01 KODER.
016700 05 DUMP PIC X VALUE 'E'.
016800 05 FELKOD PIC S9(5) COMP-3.
016900*
017000 01 W-SKILLNAD-SEK PIC 9(8).
017100 01 FILLER REDEFINES W-SKILLNAD-SEK.
017200 15 W-Z410-SS PIC 99.
017300 05 W-SKILLNAD PIC 9(6).
017400 05 FILLER REDEFINES W-SKILLNAD.
017500 10 W-Z410-AR-MAN.
017600 15 W-Z410-AR PIC 99.
017700 15 W-Z410-MAN PIC 99.
017800 10 W-Z410-DAG PIC 99.
|
This is from a online program (IMS) dated from 1981 and still running..
Uffe |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
ulfnsc wrote: |
This is from a online program (IMS) dated from 1981 and still running. |
Works for me....grin..... |
|
Back to top |
|
|
|