Topic
  • No replies
jp193
jp193
1 Post

Pinned topic I need help with a cobol program generating XML.

‏2012-07-27T19:37:04Z |
Hi,
Im from Holland so hopefully me english is ok.

I have the following problem. Im writing a cobol program (payroll) for XML. Im reading an INPUT-BEST containingg records per person, but eachperson has the following records

Record-01: Name, Adress etc

Record-02: Salary etc

Record-05: etc

Record-30: etc

Record-45

Record-50

The header of the XML will be filled with record 05
My programm has te following code:
Perform INIT-PROG

Perform until sw-eof

Perform-Fill-xml-details
Perform write-details
Perform read-file
End-perform

Perform close program etc etc

Details in the loop are going fine, so that's not the problem.

The header is the problem. I only need to read record05 in INIT-PROG one time to get the info, but i dont know how to do that?

My code was:
Perform Read-file until record-code = '05' (each record is identified by record-code)
fill the header

This is not working....i feel stupid ;-). Can anyone tell me the right code to read only record 05 in INIT-Prog? Thanks.

Jeroen