Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Suppressing leading and trailing spaces in easytrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: Suppressing leading and trailing spaces in easytrieve
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: 3158
Location: Tucson AZ

PostPosted: Wed Nov 29, 2006 5:35 pm    Post subject:
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    Post subject: Re: Suppressing leading and trailing spaces in easytrieve
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: 3158
Location: Tucson AZ

PostPosted: Thu Nov 30, 2006 6:00 pm    Post subject: Re: Suppressing leading and trailing spaces in easytrieve
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Easytrieve report shalem CA Products 4 Sun Feb 26, 2017 9:08 am
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us