Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOTTED LINE 2

Status
Not open for further replies.

krimhild

Technical User
Jul 25, 2001
7
US
What is the easiest way to create a dotted line across the page? Around seventy characters or so. Thanks.
 
hi krimhild,

First declare a working-storage entry
eg,

01 w-dotted-line pic x(70).

then code a move statement in the procedure division to fill it up with dots:

MOVE ALL "." TO W-DOTTED-LINE

The field W-DOTTED-LINE should now contain all dots, this MOVE ALL can be used to fill a field up with anything
eg
MOVE ALL "ASDF" TO W-DOTTED-LINE would fill it up thus:
"asdfasdfasdfasdfasdfasdfasdf.....etc"

hope this helps B-) jimlee
 
You can also add VALUE ALL to the declaration.

01 w-dotted-line PIC X(70) VALUE ALL "-".

Kevin
 
yup thats a lot easier, forgot about that one!
jimlee
 
Thanks for the quick and accurate responses. Those both work great.
 
just one more point, if youre assigning a value directly to your picture clause ie:

01 w-dotted-line PIC X(70) VALUE ALL "-".

you cannot do this in the file-section, only in working storage, therefore

file-section.
fd print-file.
01 print-rec.
05 dotted-line pic x(70) value all ".".

would be illegal.
jimlee
 
Hi Jimlee,

"Illegal" might be a little strong in this case; "ignored" is probably more accurate.

I make the point because a VALUE clause may appear in a copybook that may be required in either WS or in an FD or both. Ignoring the presence of the value clause in the FD makes this dual use possible.

Just a minor point, but it makes our lives a lot easier.

Jack
 
i haven't used copy books yet, but this info will no doubt be very handy when i do, cheers jimlee
 
Another handy hint:
If you want to create a dashed line with dashes alternating with spaces, the ALL literal is not limited to only one character at a time. You can use ALL "- " or ALL ". " or even ALL "ABCD". These will yield:

- - - - - - -
. . . . . . . .

ABCDABCD respectively.

Sometimes it's convenient to use different line formats.
Betty Scherber
Brainbench MVP for COBOL II
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top