Creation of Text File

 4 Replies
 1 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
apk_iyer
Basic Member
Posts: 7
Basic Member
    Hi

    I am in the process of customizing a batch report for employee's deduction.
    In that for special type of deduction I need to write in a text file .
    Can anyone let me know what are the steps I need to follow to achieve the said
    objective.


    Thanks in Advance
    John Henley
    Posts: 3353
      Assuming you are doing this the "old-fashioned" COBOL/4GL way, you would need to create a work file via workdef, and add OPEN/WRITE/CLOSE statements to the batch program. Are you creating the batch program from scratch via pgmdef/cloning another program? Or are you using paint?
      Thanks for using the LawsonGuru.com forums!
      John
      apk_iyer
      Basic Member
      Posts: 7
      Basic Member
        Thanks John

        Yes I am cloning PR276, in it for some deduction code I need to create a text file. Can you please explain how and where in the source code you need to mention open/write/close statements. I am new to this type of development work.
        L G
        Advanced Member
        Posts: 38
        Advanced Member
          Hi
          I would like to know where do we set the input /output files external filename for a sequential type workfile while running a job
          like in CSV we define CSV output external filename in jobdef
          Is there a similar way for sequential file

          John Henley
          Posts: 3353
            Lalit, you would need to change the workdef (and possibly the program itself). In workdef, you have the option of specifying a "VALUE" or "WSFLD". If you specify VALUE, and type the value in, the workfile VALUE will be created in $LAWDIR//work/VALUE/ (i.e. the VALUE is used for the directory as well as the filename. If you specify WSFLD, you type in a variable name--which MUST exist in the program's working-storage (xxxWS), and needs to be populated within the code (xxxPD) to create a different location. Note that both would be modifications to base code, and subject to overwriting via CTP/MSP, and therefore should be avoided...
            Thanks for using the LawsonGuru.com forums!
            John