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

Suppressing leading and trailing spaces in easytrieve


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
NithyaSiva

New User


Joined: 26 Nov 2006
Posts: 10
Location: Bangalore

PostPosted: Wed Nov 29, 2006 11:51 am
Reply with quote

Hello, I have an easytrieve program which reads a file and writes a report. Header of the report is written using a variable from the file. The header consitutes of a variable and a fixed text. i am concatenating this variable text and the fixed text. both are of alphanumeric 50. after concatenating, i have still 30 to 40 spaces as blanks. While printing this header, as this is aligned center (the complete text with spaces), the report looks to have a left aligned header. Can anybody help me in suppressing leading and trailing spaces. Please.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Nov 29, 2006 5:35 pm
Reply with quote

If you want to put in the work, between the index and varying parameters of the define, you could (easily) truncate the trailing blanks and (less easily) get rid of the leading blanks.

Do you have a reference guide?
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Thu Nov 30, 2006 5:34 pm
Reply with quote

Could you clarify,
are you using the HEADING or TITLE command for this?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Nov 30, 2006 6:00 pm
Reply with quote

Stumbled across this, if it works, good job VB icon_super.gif
VB wrote:
Here's a macro:

MACRO 4 FIELD1 SIZE1 FIELD2 SIZE2
*-----------------------------------------------------------------------
* THIS MACRO TAKES ONE FIELD, TRIMS IT AND CENTERS IN ANOTHER
* USES INDEXES
*-----------------------------------------------------------------------
DEFINE FIELD11 &FIELD1 1 A OCCURS &SIZE1 INDEX I1
DEFINE FIELD22 &FIELD2 1 A OCCURS &SIZE2 INDEX I2
I1 = &SIZE1
I2 = 0
&FIELD2 = ' '
DO WHILE I1 GT 0 AND FIELD11 EQ ' '
I1 = I1 - 1
END-DO
I1 = I1 + 1
IF I1 > 0
I2 = (&SIZE2 - I1) / 2 + 1
MOVE &FIELD1 TO FIELD22 I1
END-IF

To use:

FILE PERSNL
NAME-FIRST 25 8 A
W-CENTERED W 30 A
JOB INPUT PERSNL
%CENTER NAME-FIRST 8 W-CENTERED 30
DISPLAY '-' W-CENTERED '-'
Back to top
View user's profile Send private message
NithyaSiva

New User


Joined: 26 Nov 2006
Posts: 10
Location: Bangalore

PostPosted: Fri Dec 01, 2006 4:50 pm
Reply with quote

Thanks so much Thomson and IQofaGerbil.

Thomson, i will try this tomorrow and will let you know how this works. Thanks a lot for your help.
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Remove leading zeroes SYNCSORT 4
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts Count the number of characters in a f... CA Products 1
Search our Forums:

Back to Top