PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 11/17/2015 5:07 AM by  Vijay S
Best Way to add spaces in Header of a CSV file via batch Program
 6 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Vijay S
Lawson Developer
Independent consultant
Veteran Member
(389 points)
Veteran Member
Posts:167


Send Message:

--
11/13/2015 2:32 AM

    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
    Private
    Private
    Veteran Member
    (893 points)
    Veteran Member
    Posts:311


    Send Message:

    --
    11/13/2015 5:57 AM
    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
    Independent
    Independent
    Veteran Member
    (472 points)
    Veteran Member
    Posts:164


    Send Message:

    --
    11/13/2015 9:55 AM
    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
    Private
    Private
    Veteran Member
    (3487 points)
    Veteran Member
    Posts:707


    Send Message:

    --
    11/13/2015 11:22 AM
    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
    Independent
    Independent
    Veteran Member
    (472 points)
    Veteran Member
    Posts:164


    Send Message:

    --
    11/13/2015 3:03 PM
    Interesting, Kelly... have never used that routine.
    Woozy
    Private
    Private
    Veteran Member
    (3487 points)
    Veteran Member
    Posts:707


    Send Message:

    --
    11/13/2015 5:29 PM

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

     

     

    Kelly Meade
    J. R. Simplot Company
    Boise, ID
    Vijay S
    Lawson Developer
    Independent consultant
    Veteran Member
    (389 points)
    Veteran Member
    Posts:167


    Send Message:

    --
    11/17/2015 5:07 AM
    Thanks ! I was able to achieve this.
    You are not authorized to post a reply.