MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Squeeze trailing spaces

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rg_nath
Beginner


Joined: 03 Jul 2015
Posts: 23
Topics: 7

PostPosted: Thu Sep 03, 2015 8:18 am    Post subject: Squeeze trailing spaces Reply with quote

Hi,

is any function or standard macro available for squeezing (removing) trailing spaces of an Alphanumeric field in Easytrieve? i have defined one variable with length 50 and then i have moved the required value into the variable which the length is less than 50. While printing in a report, its overriding spaces with existing values. when full length of variable usage, existing values are not required as per logic.

-Nath
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Thu Sep 03, 2015 9:34 am    Post subject: Reply with quote

rg_nath,

Did you look up the Easytrieve Reference manual? If you did not find something equivalent did you think what it would take to write down your own DO WHILE/UNTIL logic which is quite similar to PERFORM statement in COBOL?
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rg_nath
Beginner


Joined: 03 Jul 2015
Posts: 23
Topics: 7

PostPosted: Thu Sep 03, 2015 10:30 am    Post subject: Reply with quote

Hi Kolusu,

As per my search in Easytrieve reference documment, i am unable to get such type of function availability. I will try with DO WHILE/UNTIL logic as you said but before that can you please give me a hint or flow of logic to begin coding. How do we trim spaces at right side of value using DO WHILE/UNTIL logic?

-Nath
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Thu Sep 03, 2015 11:03 am    Post subject: Reply with quote

rg_nath wrote:
Hi Kolusu,

As per my search in Easytrieve reference documment, i am unable to get such type of function availability. I will try with DO WHILE/UNTIL logic as you said but before that can you please give me a hint or flow of logic to begin coding. How do we trim spaces at right side of value using DO WHILE/UNTIL logic?

-Nath


I already provided you more info showing the equivalent statement PERFORM in COBOL. How do you code a PERFORM VARYING and PERFORM UNTIL ? Similarly you would code it in easytrieve. You need to remember what you learned from earlier question. Case in point is the REFERENCE Modification in easytrieve. You need to take a hint about how you define a field as 1 byte occurs which you validate for a space. Please do not expect to be spoon fed.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
NorthernDancer
Beginner


Joined: 01 May 2007
Posts: 44
Topics: 22
Location: DOWNTOWN BUFFALO, NY

PostPosted: Thu Sep 03, 2015 11:55 am    Post subject: Reply with quote

I use this SYNCSORT statement to get rid of Leading Blanks; I don't know if there is a SHIFT=RIGHT that does Trailing; never looked it up...
SORT FIELDS=COPY
OUTREC FIELDS=(1,16384,SQZ=(SHIFT=LEFT,MID=C' '))
* REMOVE MULTIPLE BLANKS BETWEEN WORDS, LEAVE ONLY 1
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Thu Sep 03, 2015 2:11 pm    Post subject: Reply with quote

I think Nath is looking for an Easytrieve solution.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Thu Sep 03, 2015 2:53 pm    Post subject: Reply with quote

Nath, can you show the code you have, the sample input, output you are getting and output you want?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Thu Sep 03, 2015 3:59 pm    Post subject: Reply with quote

NorthernDancer wrote:
I use this SYNCSORT statement to get rid of Leading Blanks; I don't know if there is a SHIFT=RIGHT that does Trailing; never looked it up...
SORT FIELDS=COPY
OUTREC FIELDS=(1,16384,SQZ=(SHIFT=LEFT,MID=C' '))
* REMOVE MULTIPLE BLANKS BETWEEN WORDS, LEAVE ONLY 1


Northerndancer,

Couple of things here

1. OP wants an easytrieve solution
2. SQZ gets rids ALL the blanks irrespective of them being leading and middle with shift=left and trailing and middle blanks with shift=right . So please suggest a solution being fully aware of full functionality of the feature.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rg_nath
Beginner


Joined: 03 Jul 2015
Posts: 23
Topics: 7

PostPosted: Tue Sep 08, 2015 4:16 am    Post subject: Reply with quote

Hi All,

As this space truncation issue is come up in one of my REPORT section while trying to display Heading part. My first heading is taking from a variable and other headings are constant values. while executing the job, First heading is over write with constant headings (spaces are placed on constant value headings as first heading is having long length). So, i have moved the constant values into variables and tried along with first heading. As of now its working fine. But not sure why Easytrieve is behaving like this. Any how thanks for all your help on this.

-Nath.
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Tue Sep 08, 2015 4:28 am    Post subject: Reply with quote

Well, we can't tell what you've done wrong without seeing the REPORT definition.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group