Best Way to add spaces in Header of a CSV file via batch Program

 6 Replies
 1 Subscribed to this topic
 18 Subscribed to this forum
Sort:
Author
Messages
Vijay S
Veteran Member
Posts: 174
Veteran Member
New Poster
New Poster
Congrats on posting!

Dear All,

 

What is the best way to add spaces in a Header for a CSV file which is generated via a Lawson 4GL batch program while using 800-WRITECSV-. I also need to add a field "Debit/Credit Separator" in the file with spaces and "/". what is the best and simple way to achieve this. CSV files doesn't take spaces and "/" when defining it in workdef. 

 

 

 

Thanks 

Vijay

Ragu Raghavan
Veteran Member
Posts: 477
Veteran Member
New Poster
New Poster
Congrats on posting!
Engaged Poster
Engaged Poster
Wow, you're on a roll!
Avid Poster
Avid Poster
Seriously, you're a posting maniac!
Engaged Reader
Engaged Reader
You are an engaged reader!
Avid Reader
Avid Reader
Avid Reader art thou!
One way of doing this:
1. define file in workdef not to have column headings
2. create the file without headings
3. define the column headings in WS
4. create a file with just the column headings
5. 'cat' the two files- you now have a csv file with the desired headings
jaherb
Veteran Member
Posts: 164
Veteran Member
New Poster
New Poster
Congrats on posting!
I accomplish this using a similar method described by Ragu. In my case, I create a text file and store it on the server, the way that I need it to be. I set the csv file up to not print headers and then at the close of the program, I concatenate the header file with the data file. Works great!
Woozy
Veteran Member
Posts: 709
Veteran Member
New Poster
New Poster
Congrats on posting!
I believe you can also do this within the COBOL code using 800-OVRDESCCSV. See the "Doc for Developers: Lawson 4GL Application Program Interfaces" document for details about this call.
Kelly Meade
J. R. Simplot Company
Boise, ID
jaherb
Veteran Member
Posts: 164
Veteran Member
New Poster
New Poster
Congrats on posting!
Interesting, Kelly... have never used that routine.
Woozy
Veteran Member
Posts: 709
Veteran Member
New Poster
New Poster
Congrats on posting!

Here are a couple of screenshots to show how this works:

 

 

Kelly Meade
J. R. Simplot Company
Boise, ID
Vijay S
Veteran Member
Posts: 174
Veteran Member
New Poster
New Poster
Congrats on posting!
Thanks ! I was able to achieve this.