Executing an ADABAS query from JCL

Hi All

I want to execute an adabas query from a natural program but I need to pass this natural query from JCL to this program. Please help me out in this.I tried all different things but no sucess.

Also is it possible to create a dynamic program or copycode using JCL?

We got a similar question here:

http://tech.forums.softwareag.com/viewtopic.php?t=7058

Thanks for the reply but could you please provide me a code snipet for this and how this can be put in the JCL as I could not make out the syntax for the it

Hi Rachit,

Similar question I raised a few months ago and was successful to create and execute a runtime query. Here is the discussion:

[url]http://tech.forums.softwareag.com/viewtopic.php?p=67377&highlight=&sid=e1eac9e3b497447f25d26c22085117c7#67377[/url]

hi Ats

Thanks…but as I can see your problem was regarding creating different reads for different ddms…but my query is to take a query from a user through jcl and execute this query(read or update) and return the result. I want all the inputs from jcl only…

If i have understood wrong can you please let me know the resolution with proper example and code?

Hi Rachit,

To explain you in more detail,

  1. The parms (to create run time query i.e. READ/FIND) such as file-name,field-names,limit,search criteria etc are being stored in a dataset

  2. The dataset is used as an input in JCL through CMWKF DD card and the JCL also invokes Natural program to read these parms

  3. The Natural then creates a runtime executable code with input details and with logic (the link I guided you to)

Hope this helps!

Now, if you are trying to pass something like below to Natural and execute it, I am not sure if this can be done, Gurus here may shade some extra light. But if you want to pass the details coded in lowercase below, it is very much possible.

READ view-name BY descriptor WHERE condition

And if you want to pass entire query through JCL like I mentioned in last post, may I know what’s the aim behind it or what actually you are trying to achieve?

Hi ATS

thanks for your quick reply.I tried your way and somewhat I am achieving what I required but I have only one small issue that is the skeleton program which will take the global variables and execute my query need to have a view definition too.But since our file names will be a variable I am unable to make out how can I run this.

Write your code in reporting mode that doesn’t required a view definition. Pass the DDM name instead of a view name.

Hope this helps!