export variable value from Natural to JCL

I’m from the client-server world, so please excuse my lack of knowledge.

Is it possible to export the value of a Natural variable to a JCL variable after a Natural program has finished running in batch mode (on VSE in our case)?

We have batch programs that create extract files that the JCL then pushes down to the C-S world via FTP. But the file names are limited in size (8 bytes).

I’d like the file names to be something along the lines of: tkdata-yyyymmdd-hhmmss.txt, which I know can be created in Natural.

If that value could be exported to a JCL variable, then theoretically, within a JCL script one could do:

put vse.file.name &varname

and the value in &varname would be the name of the file when it arrives on my end.

Is this possible? If so, how?

With Natural you can build dynamic JCL and submit it via NATRJE or Entire System Server. The contents of your JCL can thus be variable such as to specify your target file name in such a format as you propose.

One other thing you can possibly do is write what you want to pass into a dataset (WRITE WORK into CMWKFnn) and then use that dataset in a subsequent step.

I don’t believe you can pass the contents of a Natural variable into a JCL substitution variable, but there are other ways to skin this cat.

The way I understand it is that “long file name” is required as input to the FTP client, correct ?

In that case consider Brian’s option of writing the entire “put” command (well, plus all
other FTP commands you’ll need) to a file and then assign this to the FTP client as SYSIPT.