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.
July 22, 2010, 05:05 PM
MalindaHi 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
July 22, 2010, 06:21 PM
WazYou may have to post your code.
Check out the differences in the programs ?
Is there an error ?
July 23, 2010, 09:31 AM
jgelonaMalinda, 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).
July 23, 2010, 10:51 AM
MalindaHere 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
July 23, 2010, 11:25 AM
MalindaOkay 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!
May 04, 2016, 02:18 PM
John_Edwardsquote:
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
WazSometimes its like an archaeological dig.
There are hidden gems in there, just need to find them.