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

Filler to fill entire line with a character


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

New User


Joined: 29 Feb 2008
Posts: 5
Location: Chennai

PostPosted: Fri Feb 29, 2008 1:36 pm
Reply with quote

Hi,

Can we use FILLER to fill an entire line with a character like '*' or 'z'

Say for ex,

05 FILLER PIC X(129) value 'Z'.

i want the entire 129 bytes to be filled with 'z'

Please help me to achieve this..
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri Feb 29, 2008 1:42 pm
Reply with quote

Ur code will display */Z only once.U have move that many */Z inorder to display through a variable Else write a perform to display Z 129 times.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Feb 29, 2008 2:15 pm
Reply with quote

though you can say move all 'z', you can't say value all 'Z'.

but what you can do, is put a level 88 under the filler with a value of all 'Z' and then set the 88 to true at begining of program.
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 218
Location: India

PostPosted: Fri Feb 29, 2008 2:30 pm
Reply with quote

dbzTHEdinosauer wrote:
though you can say move all 'z', you can't say value all 'Z'.

but what you can do, is put a level 88 under the filler with a value of all 'Z' and then set the 88 to true at begining of program.


I did not get u dino.. Can u please explain it ...
Back to top
View user's profile Send private message
rpuhlman

New User


Joined: 11 Jun 2007
Posts: 80
Location: Columbus, Ohio

PostPosted: Fri Feb 29, 2008 4:22 pm
Reply with quote

You can use VALUE ALL 'Z'.
Code:
       IDENTIFICATION          DIVISION.                               
       PROGRAM-ID.             LCA93ZB.                                 
       ENVIRONMENT             DIVISION.                               
       DATA                    DIVISION.                               
                                                                       
       WORKING-STORAGE SECTION.                                         
                                                                       
       01  WORK-AREA.                                                   
           03  WS-BEGIN                  PIC  X(80) VALUE ALL 'Z'.     
                                                                       
       PROCEDURE DIVISION.                                             
                                                                       
           DISPLAY 'ALL CHARACTERS = ' WS-BEGIN.                       
                                                                       
           GOBACK.       
                                             
                                                                       

Successful Compile:
Code:
             **      DATE............ 29FEB08 05:37     **                     
             **      ENDEVOR RC...... 0000              **                     
             **                                         **                     
             **      ENVIRONMENT..... ENV1              **                     
             **      STAGE........... TEST              **                     
             **      SYSTEM.......... HONDA             **                     
             **      SUBSYSTEM....... LCA               **                     
             **      ELEMENT......... LCA93ZB           **                     
             **      VV.LL........... 01.00             **                     
             **      TYPE............ COB2B             **                     
             **      PROC GROUP...... CIINB1            **                     
             **      PROCESSOR....... GHBAT             **                     
             **        INIT.......... RC=0000           **                     
             **        CONWRITE...... RC=0000           **                     
             **        STDS.......... RC=0000           **                     
             **        COB........... RC=0000           **                     
             **        LKED.......... RC=0000           **                     
             **                                         **                     
             *********************************************                     

Successful Execution:
Code:
05.40.12 JOB05899  *HAMTRT01 MMT8376A STEP10               00     22     21    .

Code:
IEF375I  JOB/MMT8376A/START 2008060.0540                                       
IEF376I  JOB/MMT8376A/STOP  2008060.0540 CPU    0MIN 00.00SEC SRB    0MIN 00.00S
ALL CHARACTERS = ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Feb 29, 2008 4:24 pm
Reply with quote

rpuhlman,

good catch and post. thx
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Fri Feb 29, 2008 4:31 pm
Reply with quote

rpuhlman,

I think OP wants all Z with FILLER not with a defined variable as you have shown.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Feb 29, 2008 4:42 pm
Reply with quote

the o/p should try to help him/her-self by running a small test with something like:
Code:
xx  .....                                           
     yy .....
     yy .....
     yy FILLER  PIC  X(129) VALUE ALL 'Z'.     
     yy .....
     yy .....
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Fri Feb 29, 2008 7:04 pm
Reply with quote

Participating in this website I have found to be an excellent means to work on my patience. Of course, I have lost it on occasion.
Back to top
View user's profile Send private message
Thilaga

New User


Joined: 29 Feb 2008
Posts: 5
Location: Chennai

PostPosted: Mon Mar 03, 2008 7:55 am
Reply with quote

Hi rpuhlman,

I got it. This is what i wanted. it is not a matter of using a filler or a defined variable. But VALUE ALL works fine with both.

Thanks yaar. Thank you all for your responses...
Back to top
View user's profile Send private message
sandip_mainframe
Warnings : 2

New User


Joined: 20 Sep 2006
Posts: 63
Location: pune

PostPosted: Mon Mar 03, 2008 2:36 pm
Reply with quote

Hi,
we cann't use FILLER for displaying such value we can define any variable with value all.

ID DIVISION.
PROGRAM-ID. COBOL1.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PIC X(80) VALUE ALL '*'.
PROCEDURE DIVISION.
DISPLAY ' VALUE OF VARIABLE IS : ' A.
STOP RUN.

It wil display output as
******************************************

Thanks And Regards
Sandip Walsinge
Back to top
View user's profile Send private message
Thilaga

New User


Joined: 29 Feb 2008
Posts: 5
Location: Chennai

PostPosted: Mon Mar 03, 2008 2:41 pm
Reply with quote

Sandip,

FILLER also can be used with VALUE ALL to display such value.

I have tested the code. it works fine.

--
Thilaga.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Mon Mar 03, 2008 3:30 pm
Reply with quote

as Thilaga I've tested and works fine
Code:

05 W-HELLO-WORD.                                           
   10 W-HW-PART1          PIC X(11) VALUE 'HELLO WORLD'.   
   10 FILLER              PIC X(10) VALUE ALL '!'. 

PROCEDURE
     DISPLAY W-HELLO-WORD
       



1 minute to test it!

BTW: Phrzby Phil... very much YES!
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 Mar 03, 2008 8:49 pm
Reply with quote

Hello,

Quote:
we cann't use FILLER for displaying such value we can define any variable with value all.
Why would you believe this? Is this just your mis-understanding or were you part of an entire class that has been taught this incorrectly? Might this be some local system standard rather than a compiler issue?

If you are going to post something as fact/true, you should test it first to confirm that what you intend to post is correct. . . .
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts rewrite same SAY line CLIST & REXX 8
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top