IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is the use of FILLER in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
daks

New User


Joined: 13 Sep 2007
Posts: 3
Location: INDIA

PostPosted: Fri Sep 14, 2007 10:04 am
Reply with quote

Could anyobdy expalin me the user of FILLER

01 FILLER PIC X(9).
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Sep 14, 2007 10:32 am
Reply with quote

user of filer? icon_confused.gif 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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Sep 14, 2007 12:06 pm
Reply with quote

daks,

Generally FILLER is used for creating SLACK BYTES.
Back to top
View user's profile Send private message
daks

New User


Joined: 13 Sep 2007
Posts: 3
Location: INDIA

PostPosted: Fri Sep 14, 2007 2:23 pm
Reply with quote

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
View user's profile Send private message
chiranjeevi_mca

New User


Joined: 19 Feb 2006
Posts: 27

PostPosted: Fri Sep 14, 2007 3:18 pm
Reply with quote

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
View user's profile Send private message
daks

New User


Joined: 13 Sep 2007
Posts: 3
Location: INDIA

PostPosted: Fri Sep 14, 2007 6:18 pm
Reply with quote

its ok now.....
thanks chiranjeevi................
Back to top
View user's profile Send private message
dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Sun Sep 16, 2007 2:44 am
Reply with quote

daks wrote:

01 FILLER PIC X(9).

Bad example. Filler is never used at 01 or 77 levels.
Back to top
View user's profile Send private message
ulfnsc

New User


Joined: 15 Jan 2004
Posts: 19
Location: Stockholm, SWEDEN

PostPosted: Mon Sep 17, 2007 7:43 pm
Reply with quote

Never say never...
I have seen it in many programs....
Uffe
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Sep 17, 2007 7:48 pm
Reply with quote

77 levels might be hard to justify as FILLER, but 01 are quite often FILLER (usually without the VALUE)....
Back to top
View user's profile Send private message
lcmontanez

New User


Joined: 19 Jun 2007
Posts: 50
Location: Chicago

PostPosted: Mon Sep 17, 2007 9:05 pm
Reply with quote

FYI, you don't need to code filler with the latest cobol compiler in some situations

01 Pic X will work.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Sep 17, 2007 9:52 pm
Reply with quote

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
View user's profile Send private message
dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Tue Sep 18, 2007 11:27 am
Reply with quote

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
View user's profile Send private message
ulfnsc

New User


Joined: 15 Jan 2004
Posts: 19
Location: Stockholm, SWEDEN

PostPosted: Tue Sep 18, 2007 12:26 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Sep 18, 2007 1:44 pm
Reply with quote

ulfnsc wrote:
This is from a online program (IMS) dated from 1981 and still running.
Works for me....grin.....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Cobol prog to put an indicator on the... JCL & VSAM 1
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts COBOL program logic for comparisipn o... COBOL Programming 2
No new posts COBOL - create and write to output fi... COBOL Programming 0
No new posts COBOL to JSON COBOL Programming 1
Search our Forums:

Back to Top