How to append a record to a file

We are getting a file from Mainframe and moving the files to different systems based on the content of the file. The content of the file is nothing but some records, finally we want to add some trailer record along with the records and send it back to mainframe as a file. How to do this? Any help on this.

Muru, are you using the Mainframe Integration Server for this transaction?

I am making the following assumptions about your integration based on your prior posts:

  1. You are using FTP to move files.
  2. You are not having issues in getting the file from the Mainframe (or putting the file to your Integration Server, depending on your perspective).

Once the file is received and processed, you should take the following steps:

  1. Parse the file into a webMethods construct (i.e. Record, String, Object, Record List).

  2. Build a BRANCH step which evaluates the node containing your action-identifying variable.

  3. Create a SEQUENCE step underneath the BRANCH step for each of your possible actions.

  4. Label each SEQUENCE step with the action-identifying variable VALUE using the Properties tab. For example, if the action-identifying variable is “purchaseOrder”, then label the SEQUENCE step “purchaseOrder”. You will have unique labels for each of your SEQUENCE steps.

  5. Beneath each SEQUENCE step, perform the action to append the String (or Record or Object) to the webMethods construct that was created in Step 1. This may be a multi-step process and may require a new webMethods construct to hold the new value.

Each of the SEQUENCE steps should receive the same input (the webMethods construct created in Step 1) and should produce outputs of the SAME VARIABLE NAME. This is important for the final step.

  1. After the BRANCH step, there should be a variable in the pipeline which contains the original file from the Mainframe with the newly appended content. This String (or Record, or Object) can be PUT on the Mainframe using the FTP services in the pub.client:ftp service.

Let me know if I can expound upon any of the above steps.

Thanks for the input Dan,

Well We did similar to what you have explained here. Here is what we did to get through this.
1.The files are pushed from the mainframe and we are parsing the file with an output template using the StringtoDocument service.
2. Convert to Records.
3. Loop through the records get the action-identifying variable.(Apart from these we are having lot of other actions too).
4. Create records based on the action identifying variable.
5. Since the Trailer Records is going to have one constant and one variable we concatenated both the values in to a string.
6. Wrote a java service which will append a string to a file.
7. Invoke the java service finally to append the record.
8. Finally FTP the file to different places.