Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
You say "trailing spaces" but your example removes spaces that are not trailing. Perhaps you can more fully explain just what it is you're attempting to do?
Trailing spaces means spaces at the end of the RECORD, not the end of a field. Any spaces before ACE and ACE1 in your example records are not trailing spaces.
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
You posted in the DFSORT forum and the experts in this forum are on the west coast of the U.S. -- I doubt they were paying much attention at 1:23 AM when you last posted. If the problem is so urgent, you could have written code (in, for example, COBOL, REXX, or PL/I) by now to accomplish your goal.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Michaelod,
I was out sick yesterday.
Are the fields in fixed positions or are they in different positions delimited by a comma?
It appears you want to keep embedded blanks. Can only the second field have embedded blanks (as shown in your example) or can all of the fields have embedded blanks.
Please show a better example of input and output with more variations including embedded blanks in any fields that can have them, and fields in different positions if that's allowed.
All the fields could potentially have embedded blanks. We are unsure of the exact file layout at the moment hence the reason I have just given an example.
I have tried a few sort jobs but can only seem to remove the trailing blanks immediately prior to the comma.
Here is another example. The commas will always be in the same place in the input. The following file has a fixed length of say 50 bytes:
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
The following is from the Mainframe COBOL forum. With some minor modifications to the "TO-TBL" (in the link) and other logic, this may solve your issue.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
PAIR=QUOTE tells DFSORT NOT to remove blanks between quote pairs.
I suspect you aren't adding the quotes in your "previous process" in the right way to do what you want.
Showing part of what you did that didn't work without explaining what you're trying to do makes it impossible for anyone to help you. I'm locking this topic. Please start a new Topic and show a good example of your input records and what you expect for output with all relevant cases. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of your input file. Give the starting position, length and format of each field, or the delimiters and maximum lengths for each field.