View previous topic :: View next topic |
Author |
Message |
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Thu Sep 03, 2015 8:18 am Post subject: Squeeze trailing spaces |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
|
Posted: Thu Sep 03, 2015 9:34 am Post subject: |
|
|
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 |
|
|
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Thu Sep 03, 2015 10:30 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
|
Posted: Thu Sep 03, 2015 11:03 am Post subject: |
|
|
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 |
|
|
NorthernDancer Beginner
Joined: 01 May 2007 Posts: 44 Topics: 22 Location: DOWNTOWN BUFFALO, NY
|
Posted: Thu Sep 03, 2015 11:55 am Post subject: |
|
|
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 |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Thu Sep 03, 2015 2:11 pm Post subject: |
|
|
I think Nath is looking for an Easytrieve solution. _________________ ....Terry |
|
Back to top |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Thu Sep 03, 2015 2:53 pm Post subject: |
|
|
Nath, can you show the code you have, the sample input, output you are getting and output you want? |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12358 Topics: 75 Location: San Jose
|
Posted: Thu Sep 03, 2015 3:59 pm Post subject: |
|
|
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 |
|
|
rg_nath Beginner
Joined: 03 Jul 2015 Posts: 23 Topics: 7
|
Posted: Tue Sep 08, 2015 4:16 am Post subject: |
|
|
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 |
|
|
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Tue Sep 08, 2015 4:28 am Post subject: |
|
|
Well, we can't tell what you've done wrong without seeing the REPORT definition. |
|
Back to top |
|
|
|
|