Focal Point
[SOLVED]Getting rid of trailing spaces when outputing Format comma

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/582103144

May 17, 2010, 05:57 PM
Waz
[SOLVED]Getting rid of trailing spaces when outputing Format comma
quote:
Bored


It was a monday morning, having trouble getting started. Cool


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

July 22, 2010, 05:05 PM
Malinda
Hi guys,

I was able to get this to work in my courses program but in another procedure when I use the exact same code it won't even run it. My courses program still works but it isn't taking it with the other one. Any ideas as to what is going on? I am completely baffled!

Malinda


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
July 22, 2010, 06:21 PM
Waz
You may have to post your code.

Check out the differences in the programs ?

Is there an error ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

July 23, 2010, 09:31 AM
jgelona
Malinda, a few messages up you asked if what I suggested would work on windows. Answer is yes. The default record length for alpha files in both windows and linux is variable. If you use HOLDFORMAT COMT or HOLDFORMAT TAB, you will have no trailing spaces in fields or records, you'll get a .mas file that will let you read the file and the file will be alpha (versus HOLDFORMAT BINARY where numeric fields are stored as Binary).


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
July 23, 2010, 10:51 AM
Malinda
Here is my code from my courses file that works:
 TABLE FILE CALLHLD
PRINT
     'CALLHLD.SEG01.TERM'
     'CALLHLD.SEG01.SITE_ID'
     'CALLHLD.SEG01.START_DATE'
     'CALLHLD.SEG01.TITLE'
     'CALLHLD.SEG01.COURSE_ID'
     'CALLHLD.SEG01.DESC'
     'CALLHLD.SEG01.PUBLISH'
     'CALLHLD.SEG01.END_DATE'
     'CALLHLD.SEG01.TEMPLATE'
BY 'CALLHLD.SEG01.TERM' NOPRINT
BY 'CALLHLD.SEG01.COURSE_ID' NOPRINT
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT DFIX DELIMITER , ENCLOSURE " HEADER NO 


In my new program I had to use the MORE to combine 2 of my hold files. I then want to get this combined file to output in csv with no trailing spaces. Here is my code for that:
 TABLE FILE CSCUSTU2
PRINT 
     'CSCUSTU2.SEG01.EMPLID'
     'CSCUSTU2.SEG01.USERNAME'
     'CSCUSTU2.SEG01.CSC_EMAIL'
     'CSCUSTU2.SEG01.ROLE'
     'CSCUSTU2.SEG01.BIRTHDATE'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF 
ON TABLE NOTOTAL
ON TABLE HOLD AS CSCUSAKAI FORMAT FOCUS
  MORE
  FILE CSCUFAC2
END
TABLE FILE CSCUSAKAI
PRINT 
     'CSCUSAKAI.SEG01.USERNAME'
     'CSCUSAKAI.SEG01.CSC_EMAIL'
     'CSCUSAKAI.SEG01.ROLE'
     'CSCUSAKAI.SEG01.BIRTHDATE/M|D|YY'
BY 'CSCUSAKAI.SEG01.EMPLID'
HEADING
""
FOOTING
""
ON TABLE SET PAGE-NUM OFF 
ON TABLE SET BYDISPLAY ON 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT DFIX DELIMITER , ENCLOSURE " HEADER NO  



WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
July 23, 2010, 11:25 AM
Malinda
Okay I don't know what is going on but now it is working no problem. I didn't change anything and it is running. Must have been something up with the servers yesterday.

Thanks for the help though!


WebFOCUS 7.6.11
Windows
all output (Excel, HTML, PDF)
May 04, 2016, 02:18 PM
John_Edwards
quote:
Originally posted by Francis Mariani:
One way to solve this would be to COMPUTE only one output field, concatenating all the fields you require into that one field, including the commas and quotes.


Francis saves me work yet again!



May 04, 2016, 04:50 PM
Waz
Sometimes its like an archaeological dig.

There are hidden gems in there, just need to find them.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!