Page 1 of 2

difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Tue Aug 10, 2010 8:41 pm
by david
I hava a REXX prog to get return code of a job.
THE name of rexx prog is REXXGETS.
The rexx prog is :
jobname = 'XMITJ'
queue 'set confirm off'
queue 'owner *'
queue 'prefix *'
queue 'h'
queue 'select 'jobname
queue 'afd refresh'
queue 'find 'jobname
queue ''
'execio * diskw isfin (finis'
parm = '/ ++20,500'
address linkpgm 'sdsf parm'
'execio * diskr isfout (stem tmpline. finis'
say tmpline.0
posjobname = 0
posjobid = 0
posmaxrc = 0
do i = 1 to tmpline.0 while posjobname = 0
posjobname = index(tmpline.i, 'JOBNAME')
posjobid = index(tmpline.i, 'JobID')
posmaxrc = index(tmpline.i, 'Max-RC')
if posjobname > 0 then
do
say 'posjobname = ' posjobname
say 'posjobid = ' posjobid
say 'posmaxrc = 'posmaxrc
end
end
do i = 1 to tmpline.0
if(pos(jobname,tmpline.i)) > 0 then
do
say 'tmpline.i = ' tmpline.i
jobname1 = strip(substr(tmpline.i, posjobname ,8 )
jobid = strip(substr(tmpline.i, posjobid, 7)
maxrc = strip(substr(tmpline.i, posmaxrc, 10))
end
end
say 'jobname = ' jobname1
say 'jobid = ' jobid
say 'maxrc = ' maxrc


when I use EXEC in front of member in ds,like this: EXEC REXXGETS
it can generate right result.

when i use the job to submit the REXX,it can generate wrong result.

//GETSTEP EXEC PGM=IKJEFT01,COND=(4,LT)
//SYSEXEC DD DSN=TMAP006.BAT.SRCLIB,DISP=SHR
//ISFIN DD DSN=TMAP006.BAT.ISFIN,DISP=(NEW,CATLG),UNIT=3390,
// VOL=SER=SYSNEW,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920),
// SPACE=(TRK,(30,30))
//ISFOUT DD DSN=TMAP006.BAT.ISFOUT,DISP=(NEW,CATLG),UNIT=3390,
// VOL=SER=SYSNEW,
// DCB=(RECFM=FBA,LRECL=301,BLKSIZE=27993),
// SPACE=(CYL,(30,30))
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
REXXGETS
/*
so ,anybody can tell why?

Re: difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Tue Aug 10, 2010 8:53 pm
by MrSpock
Don't have SDSF available so I can't help much, but, what I'd do is to go back to my base TSO session (Not my ISPF session. I'd exit that and go back to the TSO READY prompt). Then, I'd free any allocated DD's. Once that was done, I'd allocate the ISFIN and ISFOUT the same way your job does. Finally, I'd enter the TSO command EX 'TMAP006.BAT.SRCLIB(REXXGETS)' and see what happens. If that also fails, then the logical conclusion is that there are other necessary datasets that need to be allocated in order for the address linkpgm 'sdsf parm' command to function (maybe you need a JOBLIB or STEPLIB??).

Or, you could change your job to run your exec in a similar ISPF Address space instead of TSO and see if it makes any difference.

Re: difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Wed Aug 11, 2010 10:21 am
by david
OPTION 6, EX 'TMAP006.BAT.SRCLIB(REXXGETS)' it can also get right result.

If that also fails, then the logical conclusion is that there are other necessary datasets that need to be allocated in order for the address linkpgm 'sdsf parm' command to function (maybe you need a JOBLIB or STEPLIB??).

Could you give me more details?

Re: difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Wed Aug 11, 2010 4:35 pm
by NicC
You have to exec your pgm in batch...

    EXEC 'XXX.YYYYYYY.EXEC(pgmname)' 'a parm'

Re: difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Wed Aug 11, 2010 5:18 pm
by david
I Did THAT. exec pgm in batch.But the result is wrong.

When I did (EX 'TMAP006.BAT.SRCLIB(REXXGETS)'), it could also get right result.

I think 'address linkpgm 'sdsf parm' ' can't run in no ISPF service.

Re: difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Wed Aug 11, 2010 5:36 pm
by NicC
In that case you will have to use ISPSTART in IKJEFT01 an provide the necessary DDNAMEs for the ISPF files.

Re: difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Wed Aug 11, 2010 6:07 pm
by MrSpock
I never did ask, but what exactly did you mean by

when i use the job to submit the REXX,it can generate wrong result.


Are you saying that everything works, but your results in ISFOUT are different or wrong?

Re: difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Wed Aug 11, 2010 6:11 pm
by david
My useid is TMAP006
'the ISPF files' is TMAP006.ISPF.ISPPROF or any others?
'use ISPSTART in IKJEFT01 ' means what? like this :
//SYSTSIN DD *
PROFILE PREFIX(TMAP006)
PROFILE NOPROMPT
ISPSTART PANEL(ISR@PRIM) NEWAPPL(ISR)
EXEC MYREXX(REXXGETS) EXEC
/*
BUT after run the job :
IEF861I FOLLOWING RESERVED DATA SET NAMES UNAVAILABLE TO JREXX
IEF863I DSN = TMAP006.ISPF.ISPPROF JREXX RC = 04
IEF099I JOB JREXX WAITING FOR DATA SETS

Re: difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Wed Aug 11, 2010 6:14 pm
by david
when i use the job to submit the REXX,it can generate wrong result.

yes, i mean everything works, but results in ISFOUT are wrong.

Re: difference between EXEC a rexx pg and submit a rexx pg

PostPosted: Wed Aug 11, 2010 6:19 pm
by david
USING option 6 :EX 'TMAP006.BAT.SRCLIB(REXXGETS)' EXEC
the results is right like this:
input jobname
160
posjobname = 8
posjobid = 17
posmaxrc = 281
jobname = XMITJ
jobid = JOB02946
maxrc = JCL ERROR

USing jOB: the results is:
input jobname
160
posjobname = 8
posjobid = 17
posmaxrc = 281
jobname = HELD OUT
jobid = UT DISPL
maxrc =