Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groovy script (using JCLExec) executes with no errors,but job is not getting submitting. #20

Open
PriyaVP-crypto opened this issue Jan 24, 2020 · 17 comments

Comments

@PriyaVP-crypto
Copy link

Hi ,

I have created a script to submit a job using JCLExec API, while executing it, it compiles successfully with no error or warning messages. But the job is not getting submitting. Even the display statements in the scripts are not getting displayed.

Attaching the sample code I tried.

SubmitJCL.txt

@dajsen
Copy link

dajsen commented Jan 24, 2020

Hi,
You mean that you execute it but it doesn't behave as expected, it doesn't even output anything (your displays)...
Compare your stuff with this one: https://www.ibm.com/support/knowledgecenter/en/SS6T76_1.0.6/javadoc/com/ibm/dbb/build/JCLExec.html

@PriyaVP-crypto
Copy link
Author

Hi @dajsen

Thanks for your response.

Yes, what you said about the problem is correct. I referred the link that you shared. From my understanding, the code is in accordance with the document.

I cant figure out what the issue is since even the first statement in the code which is a display statement is not working.

Thanks.

@dajsen
Copy link

dajsen commented Jan 27, 2020

You have Java/Groovy installed, right ?
Think your script is fine, you are probably running it the wrong way...
Output testing the first println of yours...

/u/xxxx/scripts/./test.sh
/usr/lpp/IBM/dbb/bin/groovyz testprint.groovy
/u/xxxx/scripts>
trying to set config
** Build finished

content of test.sh
#!/bin/sh
DBB_HOME=/usr/lpp/IBM/dbb
CMD="$DBB_HOME/bin/groovyz testprint.groovy $@"
echo $CMD
$CMD

content of testprint.groovy
import com.ibm.dbb.build.*
println("trying to set config")

@PriyaVP-crypto
Copy link
Author

Hi @dajsen

Yes we have Java installed.

We placed the groovy script on the user path. Is there any specific path to place it?
We tried the shell script to invoke the groovy,but that also did not give the desired output.

Appreciate your help.

@dennis-behm
Copy link
Member

Before going down the path of enabling all the tracing, can you please check, that you use a Java 8 64 bit? Here is a link to all prereqs:
https://www.ibm.com/support/knowledgecenter/SS6T76_1.0.7/prerequisites.html

Can you issue groovy --version?

DBEHM:/u/dbehm: >/u/dbehm/dbb100/bin/usr/lpp/IBM/dbb_1.0.7/bin/groovyz --version
Groovy Version: 2.4.12 JVM: 1.8.0_211 Vendor: IBM Corporation OS: z/OS

@PriyaVP-crypto
Copy link
Author

Hi @dennis-behm

We do have Java 8.

Here is the result for the version command:

IBMUSER:/VERSYSB/usr/lpp/IBM/dbb/bin: >groovyz --version
./groovy-2.4.12/bin/groovy: ./groovyz 75: FSUM7351 not found
** Build finished

Hope this will give an idea what is missing.

@dennis-behm
Copy link
Member

@PriyaVP-crypto
You are missing the two environment variables DBB_CONF and DBB_HOME, these will make groovyz available in your path.
For a quick fix, just EXPORT them, or put them into your .profile
https://www.ibm.com/support/knowledgecenter/SS6T76_1.0.7/setup_dbb_toolkit.html

@dajsen
Copy link

dajsen commented Jan 27, 2020

ooops, didn't supply the most critical part of it all.
Thanx @dennis-behm

@PriyaVP-crypto
Copy link
Author

Hi,

We tried to EXPORT it and got the below response:

IBMUSER:/u/ibmuser: >export JAVA_HOME=/usr/lpp/java/J8.0_64
IBMUSER:/u/ibmuser: >export DBB_HOME=/usr/lpp/IBM/dbb
IBMUSER:/u/ibmuser: >export DBB_CONF=/usr/lpp/IBM/dbb/conf
IBMUSER:/u/ibmuser: >/usr/lpp/IBM/dbb/bin/groovyz updgr.groovy
** Build finished
IBMUSER:/u/ibmuser: >cd /usr/lpp/IBM/dbb/bin
IBMUSER:/VERSYSB/usr/lpp/IBM/dbb/bin: >groovyz--version
groovyz--version: FSUM7351 not found
IBMUSER:/VERSYSB/usr/lpp/IBM/dbb/bin: >groovyz --version
./groovy-2.4.12/bin/groovy: ./groovyz 75: FSUM7351 not found
** Build finished

@dajsen
Copy link

dajsen commented Jan 28, 2020

Try running this in USS, works for me... Same as the one supplied yesterday, just added DBB_CONF....
#!/bin/sh
DBB_HOME=/usr/lpp/IBM/dbb
DBB_CONF=/usr/lpp/IBM/dbb/conf
CMD="$DBB_HOME/bin/groovyz updgr.groovy $@"
echo $CMD
$CMD

And just to be 100% certain that it works I have these imports in the groovy script:
@groovy.transform.BaseScript com.ibm.dbb.groovy.ScriptLoader baseScript
import com.ibm.dbb.build.*
import groovy.util.*

@dennis-behm
Copy link
Member

@PriyaVP-crypto can you check if you are using this path? It can actually be in another directory /usr/lpp/IBM/dbb

@PriyaVP-crypto
Copy link
Author

Hi, @dajsen

The response of running looks like:

**test.sh ->**

#!/bin/sh
DBB_HOME=/usr/lpp/IBM/dbb
DBB_CONF=/usr/lpp/IBM/dbb/conf
CMD="$DBB_HOME/bin/groovyz updgr.groovy $@"
echo $CMD
$CMD

**updgr.groovy >**

@groovy.transform.BaseScript com.ibm.dbb.groovy.ScriptLoader baseScript
import com.ibm.dbb.build.CopyToHFS
import com.ibm.dbb.build.DBBConstants
import com.ibm.dbb.build.JCLExec




/* DBB_CONF must be set for running JCLExec */
def confDir = System.getenv("/usr/lpp/IBM/dbb/conf")

/* The data set contains the ZUnit JCL */
/* For example:  &HLQ.ZUNIT.JCL        */
def jclDataset = &CBS.ZCON.JCL.SRCE

/* The ZUnit JCL */
/* For example:  ZUNIT001   */
def jclMember = BIND2



println "Running ZUnit in JCL '$jclDataset($jclMember)'"

/* Execute the JCL */
def exec = new JCLExec()
int rc = exec.dataset(jclDataset).member(jclMember).confDir(confDir).execute()

/* Check the return code from the submitted job */
def maxRC = exec.maxRC
if (maxRC == 'CC 0000')
    println "The JCL Job ${exec.submittedJobId} completed successfully"
else
    println "The JCL Job ${exec.submittedJobId} completed with Max-RC: $maxRC"

/* Copy the result from the data set member to a temporary file on zFS to parse the XML */    
println("Execute JCL and save the SYSPRINT output to zFS file")
exec.saveOutput('SYSPRINT',  new File("/u/ibmuser/sysprint.out"), "UTF-8")

println("done")

**Execution :**
IBMUSER:/u/ibmuser: >./test.sh 
IBMUSER:/u/ibmuser: >          

Hi @dennis-behm ,

the listing of path looks like :

IBMUSER:/VERSYSB/usr/lpp/IBM/dbb: >ls
IBM bin groovy-2.4.12 migration
archive conf lib

@dajsen
Copy link

dajsen commented Jan 28, 2020

So still NO OUTPUT ?
Your jclDataset def looks a bit weird, &CBS is a property delivered by ?
def jclDataset = &CBS.ZCON.JCL.SRCE
Put a println at the beginning of your groovy script, still NO OUTPUT ?

@PriyaVP-crypto
Copy link
Author

No output.....Even when first line is println....

@dajsen
Copy link

dajsen commented Jan 28, 2020

Hi,
Your EXPORT above shows some differences, where is DBB installed ?
/usr/lpp/IBM/dbb/
/VERSYSB/usr/lpp/IBM/dbb

Where do you keep your shellscript and groovyscript (which folder) ?

@PriyaVP-crypto
Copy link
Author

Hi,

Sorry for the delayed reply.

There is been some installation issues regarding DBB and team is been looking after them.

Hopefully all errors will be resolved after the fix.

@dajsen
Copy link

dajsen commented Feb 5, 2020

@PriyaVP-crypto
No, problem. Suspected that you figured out what the problem was.
Nice to have feedback so that we all can learn something from every issue getting solved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants