View previous topic :: View next topic
|
Author |
Message |
elangovan_paul
New User
Joined: 30 Mar 2007 Posts: 7 Location: Chennai
|
|
|
|
Hi All,
A report getting created out of mainframe is displaying page number. The page number is defined as a numeric field. My requirement is to display blanks instead of the page number.
The definition of the field is as given below.
01 HEADER1.
05 FILLER PIC X(75).
05 PAGE1 PIC 9(05).
05 FILLER PIC X(52).
I am planning to redefine the field PAGE1 with PAGE2 and define the field as alphanumeric as follows:
01 HEADER1.
05 FILLER PIC X(75).
05 PAGE1 PIC 9(05).
05 PAGE2 REDEFINES PAGE1.
10 WS-PAGE1 PICX(05) VALUE SPACES.
05 FILLER PIC X(52).
and then move spaces to this field PAGE2.
Please let me know if this would work.
Thanks in Advance.
Regards,
Elango |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Have you tried running it?
Surely you should get errror.
it will work if you remove value clause and move spaces in procedure division. |
|
Back to top |
|
|
elangovan_paul
New User
Joined: 30 Mar 2007 Posts: 7 Location: Chennai
|
|
|
|
Have not ran the job yet Sambhaji...
Oh you mean to say that we can not move spaces to a variable that has been initialized with spaces already...
I shall try and let you know the outcome.
Thanks anyway.
Regards,
Elango |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
Oh you mean to say that we can not move spaces to a variable that has been initialized with spaces already...
|
i dont mean that. I mean it will give compilation error when you try to use value clause in redefined variable. so you have to remove that and move spaces to variable in procedure division |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
You can use reference modification. The compiler will then treat your display-numeric field as alphanumeric. The field length is not necessary.
Code: |
03 PAGE1 PIC 9(05).
MOVE SPACES TO PAGE1 (1:). |
BEWARE..Just don't put your name to it. Many sites compare it with an "excercise" which "can" be done by male dogs & they don't like it...They may send a search and destroy team after you.. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Or you could define PAGE1 as PIC Z(05) and move zero to it before printing. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Is the page number needed part of the time and spaces need part of the time? If the need for the page number has been completely removed, i'd suggest removing the field and declaring the header as spaces.
Where/how is the page number being incremented? If the page number is still needed part of the time and the field in the header is being incremented, moving spaces there could be a problem.
FWIW. |
|
Back to top |
|
|
ramakrishnag
New User
Joined: 10 Sep 2008 Posts: 6 Location: india
|
|
|
|
Hi
You can directly define the Page number as X(05) value spaces.
It is editing variable. before print command you can pass the numeric page number to this alpha-numeric variable.
If you dont want to print the page number then dont pass the numeric value in this page variable then it will be any way value is space by defalut.
Thanks,
Rama |
|
Back to top |
|
|
ridgewalker58
New User
Joined: 26 Sep 2008 Posts: 51 Location: New York
|
|
|
|
Remove the VALUES SPACES.
Move SPACES TO WS-PAGE1.
***BUT*** before you do any ADD to PAGE1
YOU MUST MOVE ZEROS TO PAGE2 or WS-PAGE1.
05 PAGE1 PIC 9(05).
05 PAGE2 REDEFINES PAGE1.
10 WS-PAGE1 PICX(05) VALUE SPACES |
|
Back to top |
|
|
|