coffeyr
September 16th, 1999, 07:31 AM
I am trying to write a program that will read records from a flat file (around 40-50 characters on a line, then there is a carriage return line feed and then next record).
Then I would like to convert/extract pertinent info from each record to send it to an AS/400 server, preferably with a time stamp, a 12 character number and 0 or 1 key number for identification purposes.
Finally, test to see if the flat file is at the end of file (obviously, if false, continue with next record). If true, Write to a new file (a backup file that will contain the data from the original flat file) and delete the original flat file.
An example of the flat file, as follows:
199909020646500700201610016782000000000NL070V100000000I4X1FA15B1C10D6V1000025054054100026001002
199909020646520700201600240195000000000NL070V1000000000I4X1FA15B1C9D6V1000025054054200026001002
199909020646540700201600284792000000000NL070V1000000000I3X1FA15B1C8D6V1000025054054300026001002
What I know!
I will open the file using Open and then use the Line Input statement to read the data one record at a time. Then use the Eof function to see when I have reached the end of the file.
I don't know how to send the information to the other computer. The middleware and communication between the PC and server is MQSeries (The AS/400 will not return anything to the PC).
I do not know how to send the information and how to write to a new file and continually append to it (without deleting anything from the written file)....
Thank you for your help in advance!
Respectfully,
Robert Coffey
Then I would like to convert/extract pertinent info from each record to send it to an AS/400 server, preferably with a time stamp, a 12 character number and 0 or 1 key number for identification purposes.
Finally, test to see if the flat file is at the end of file (obviously, if false, continue with next record). If true, Write to a new file (a backup file that will contain the data from the original flat file) and delete the original flat file.
An example of the flat file, as follows:
199909020646500700201610016782000000000NL070V100000000I4X1FA15B1C10D6V1000025054054100026001002
199909020646520700201600240195000000000NL070V1000000000I4X1FA15B1C9D6V1000025054054200026001002
199909020646540700201600284792000000000NL070V1000000000I3X1FA15B1C8D6V1000025054054300026001002
What I know!
I will open the file using Open and then use the Line Input statement to read the data one record at a time. Then use the Eof function to see when I have reached the end of the file.
I don't know how to send the information to the other computer. The middleware and communication between the PC and server is MQSeries (The AS/400 will not return anything to the PC).
I do not know how to send the information and how to write to a new file and continually append to it (without deleting anything from the written file)....
Thank you for your help in advance!
Respectfully,
Robert Coffey