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

 6 Replies
 1 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
Vijay S
Veteran Member Send Private Message
Posts: 174
Veteran Member

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 Send Private Message
Posts: 477
Veteran Member
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 Send Private Message
Posts: 164
Veteran Member
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 Send Private Message
Posts: 709
Veteran Member
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 Send Private Message
Posts: 164
Veteran Member
Interesting, Kelly... have never used that routine.
Woozy
Veteran Member Send Private Message
Posts: 709
Veteran Member

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

 

 

Kelly Meade
J. R. Simplot Company
Boise, ID
Vijay S
Veteran Member Send Private Message
Posts: 174
Veteran Member
Thanks ! I was able to achieve this.