Creation of Text File

 4 Replies
 1 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
apk_iyer
New Member Send Private Message
Posts: 0
New 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
Send Private Message
Posts: 3351
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
New Member Send Private Message
Posts: 0
New 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 Send Private Message
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
Send Private Message
Posts: 3351
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