Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ISFROWS returns 0
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Apr 21, 2015 12:10 pm    Post subject: ISFROWS returns 0
Reply with quote

Hi All,
I am using SDSF REXX to retrieve the return code of the job submitted through REXX. But when giving display for the ISFROWS it returns 0 value due to which the loop is not processed. i got the sample code from websites and wrote as using SDSF with REXX is new to me. some please help me why is that ISFROWS is returning 0 when there are jobs in the spool.

please see the code which i have used:

Code:

 "SUBMIT '"DSN"' "   /* DSN holds the JCL that is submitted */
 RC=ISFCALLS("ON")
 ISFOWNER = 'JOB*'
 ISFPREFIX = 'JOBID*'
 ADDRESS SDSF "ISFEXEC ST"
 IF RC <> 0 THEN
    EXIT RC
 FIXEDFIELD = WORD(ISFCOLS,1)
 SAY "NUMBER OF ROWS RETURNED:" ISFROWS
 DO IX =1 TO ISFROWS
    SAY "NOW PROCESSING JOB:" VALUE(FIXEDFIELD"."IX)
    DO JX = 1 TO WORDS(ISFCOLS)
       COL = WORD(ISFCOLS,JX)
       SAY "COLUMN" COL"."IX "HAS THE VALUE:" VALUE(COL"."IX)
    END
 END
 RC=ISFCALLS('OFF')



Kindly help me in solving this problem....


Thanks in advance
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Apr 21, 2015 12:50 pm    Post subject:
Reply with quote

From your code, you seem to be looking for a job with name "JOBID*' submitted by owner "JOB*" . Are these the names of the job(s) and the job owner(s) you want to process? These look very like the names of the SDSF fields you are expected to populate with values rather than the values you should be supplying.

Garry.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Apr 21, 2015 1:00 pm    Post subject:
Reply with quote

Garry Carroll wrote:
From your code, you seem to be looking for a job with name "JOBID*' submitted by owner "JOB*" . Are these the names of the job(s) and the job owner(s) you want to process? These look very like the names of the SDSF fields you are expected to populate with values rather than the values you should be supplying.

Garry.


Hi,
I am not aware of the use of PREFIX and OWNER in this code....I thought that its just way of defining that it has prefix and owner....now the use of that...But as per my need OWNER can be any one whoever runs the rexx program and prefix also the same case. So i tried giving ISFPREFIX = ' ' and ISFOWNER = ' ' but i get error like "REXX SERVICE IRXEXCOM FAILED, Return code FFFFFFFE, reason 00000000. "

Can you tell how to solve this issue what value should I define for PREFIX and OWNER....?
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Apr 21, 2015 1:06 pm    Post subject:
Reply with quote

If you supply ISFPREFIX = '*' and ISFOWNER = userid(), you would get returned every job submitted by the current REXX user. If the jobname is the userid followed by some character, you set ISFPREFIX = userid() ¦¦ '*'.

You are getting the error because SDSF expects some value in the fields, not nulls.

Garry.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Apr 21, 2015 1:22 pm    Post subject:
Reply with quote

Garry Carroll wrote:
If you supply ISFPREFIX = '*' and ISFOWNER = userid(), you would get returned every job submitted by the current REXX user. If the jobname is the userid followed by some character, you set ISFPREFIX = userid() ¦¦ '*'.

You are getting the error because SDSF expects some value in the fields, not nulls.

Garry.


Thanks a lot...code is working fine now....and one more thing, like now all the jobs that are submitted in my userid is retrieved. Is there a way to get the job which is submitted latest. can we obtain that through JOB ID that is created when submitting the job.....? Also I just cannot take the last row because some user might have sorted the spool based on Return code and other might be based on JOBID ....so suggest me any other way please....
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Apr 21, 2015 1:35 pm    Post subject:
Reply with quote

You can set ISFFILTER to the JobID value obtained when submitting the job e.g. ISFFILTER = submitted_jobid_returned.

Have you googled/read the IBM Redbook "Implementing REXX Support in SDSF" ?

Garry.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Apr 21, 2015 6:33 pm    Post subject:
Reply with quote

Garry Carroll wrote:
You can set ISFFILTER to the JobID value obtained when submitting the job e.g. ISFFILTER = submitted_jobid_returned.

Have you googled/read the IBM Redbook "Implementing REXX Support in SDSF" ?

Garry.


Hi Garry,
I tried with ISFFILTER Like below and I am getting command failed messages without displaying anything.


Code:

    CALL OUTTRAP(P.)
    "SUBMIT '"DSN"' "
    CALL OUTTRAP(OFF)
    FRSTPOS = POS('(',P.2)
    JOBNUM = SUBSTR(P.2,(FRSTPOS+1),8)
    RC=ISFCALLS("ON")
    ISFOWNER = USERID()
    ISFPREFIX = USERID()||'*'
    ISFFILTER = JOBNUM
    ADDRESS SDSF "ISFEXEC ST"
    IF RC <> 0 THEN
       EXIT RC
    SAY "NUMBER OF ROWS RETURNED:" ISFROWS
    DO IX =1 TO ISFROWS
     SAY WORDS(ISFCOLS)
        DO JX = 1 TO WORDS(ISFCOLS)
           JBN = WORD(ISFCOLS,3)
           RTC = WORD(ISFCOLS,20)
           SAY "JOB NUMBER:" JOBNUM
           SAY "VALUE OF JOB:" VALUE(JBN"."IX)
           IF JOBNUM = VALUE(JBN"."IX) THEN
            DO
               SAY "MATCHED WITH" VALUE(JBN"."IX)
              IF VALUE(RTC"."IX) == 0 THEN
                DO
                 SAY "RETURN CODE PASSED"
                 CALL ANALYSERPT
                END
              ELSE DO
                 SAY "JOB SUBMITTED HAS RETURN CODE" VALUE(RTC"."IX)
                 EXIT
                END
            END
        END
     END
     RC=ISFCALLS('OFF')
RETURN


Should it be JOB NUM or JOBID for ISFFILER.... I tried giving both but the message COMMAND FAILED is returned with displaying anything execution is stopped. Can ou let me know why is it occuring.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Apr 21, 2015 6:54 pm    Post subject:
Reply with quote

I did a cut&paste of your code and ran in debug (trace = ?r). I added in some say statements - say p.0; say p.1; say p.2 and found the jobname/jobid is returned in p.1, not p.2 . When I changed to
Code:
 JOBNUM = SUBSTR(P.1,(FRSTPOS+1),8)

I got the correct JobID.
You should set
Code:
 ISFFILTER = 'JobID EQ '¦¦JOBNUM
The command takes the same format as if you were entering "FILTER JobID EQ JOBnnnnn" in SDSF panels.


Garry.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Apr 21, 2015 7:46 pm    Post subject:
Reply with quote

Garry Carroll wrote:
I did a cut&paste of your code and ran in debug (trace = ?r). I added in some say statements - say p.0; say p.1; say p.2 and found the jobname/jobid is returned in p.1, not p.2 . When I changed to
Code:
 JOBNUM = SUBSTR(P.1,(FRSTPOS+1),8)

I got the correct JobID.
You should set
Code:
 ISFFILTER = 'JobID EQ '¦¦JOBNUM
The command takes the same format as if you were entering "FILTER JobID EQ JOBnnnnn" in SDSF panels.


Garry.


I tried my code with the ISFFILTER as you mentioned and now it returns the job which is submitted and the ISFROWS value is now 0... That should be 1 right why is that it is displaying the 0 value and ISFROWS display the rows starting from the jobs submitted and now since we have filtered with jobid that is submitted it show 1 right....?

Code:

RC=ISFCALLS("ON")
ISFOWNER = USERID()
ISFPREFIX = USERID()||'*'
ISFFILTER = 'JOBID EQ'||JOBNUM
ADDRESS SDSF "ISFEXEC ST"
IF RC <> 0 THEN
   EXIT RC
   COLS = WORDS(ISFCOLS)
   JBN = WORD(ISFCOLS,3)
   RTC = WORD(ISFCOLS,20)
   SAY "JOBNUMBER & RETURN CODE"  JBN RTC
   IF VALUE(JBN"."1) = JOBNUM THEN
      DO
       IF VALUE(RTC"."1) = 0 THEN
           DO
            SAY "RETURN CODE PASSED"
               CALL ANALYSERPT
              END
            ELSE DO
               SAY "JOB SUBMITTED HAS RETURN CODE" VALUE(RTC"."IX)
               EXIT
              END
          END
   RC=ISFCALLS('OFF')


I think the ISFROWS is not taking the job that is submitted that is why is it is showing 0...But why is that happening....even before using the filter all the jobs are taken in the ISFROWS but the job that is currently submitted was not taken....
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Tue Apr 21, 2015 8:16 pm    Post subject:
Reply with quote

Hello,
Could you try including
ISFSYSNAME = '*'

So that all the systems with shared JES are included.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Apr 21, 2015 8:19 pm    Post subject:
Reply with quote

vasanthz wrote:
Hello,
Could you try including
ISFSYSNAME = '*'

So that all the systems with shared JES are included.


Even then the above mentioned scenario exists. ISFROWS remains 0.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Apr 21, 2015 9:12 pm    Post subject:
Reply with quote

I seem to find isfrows = 0 where ISFFILTER is used, but don't see that documented (yet). Without the ISFFILTER, I get isfrows set > 0.

I've put in
Code:
     ISFCOLS   = "JNAME JobID DDNAME TOKEN"     
before the
Code:
    ADDRESS SDSF "ISFEXEC ST " 
and can check:
Code:
    if jname.0 ¬= 0                             
       then do i = 1 to jname.0                   
             say 'isfrows = ' isfrows             
             say  jobid.i                         
       end   


I can then compare jobid.i with the value saved from job submission. Once you have that, to get into the JESMSGLG dataset, you will need to use ISFACT e.g.
Code:
  Address SDSF ,                                       
    "ISFACT DA TOKEN('"token.i"') PARM(NP ?) " ,       
       " (ALTERNATE DELAYED PREFIX J_)"               


This returns isfrows2 which you can control a loop to find JESMSGLG (or whatever sdsf ddname available). Then you can read in the file and look for the values (cond codes). - see pages 91/92 of the Redbook.

Hope this helps.

Garry.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue Apr 21, 2015 10:58 pm    Post subject:
Reply with quote

Garry Carroll wrote:
I seem to find isfrows = 0 where ISFFILTER is used, but don't see that documented (yet). Without the ISFFILTER, I get isfrows set > 0.

I've put in
Code:
     ISFCOLS   = "JNAME JobID DDNAME TOKEN"     
before the
Code:
    ADDRESS SDSF "ISFEXEC ST " 
and can check:
Code:
    if jname.0 ¬= 0                             
       then do i = 1 to jname.0                   
             say 'isfrows = ' isfrows             
             say  jobid.i                         
       end   


I can then compare jobid.i with the value saved from job submission. Once you have that, to get into the JESMSGLG dataset, you will need to use ISFACT e.g.
Code:
  Address SDSF ,                                       
    "ISFACT DA TOKEN('"token.i"') PARM(NP ?) " ,       
       " (ALTERNATE DELAYED PREFIX J_)"               


This returns isfrows2 which you can control a loop to find JESMSGLG (or whatever sdsf ddname available). Then you can read in the file and look for the values (cond codes). - see pages 91/92 of the Redbook.

Hope this helps.

Garry.


Hi,
While comparing the jobid.i with the jobid number obtained from submission it doesnt match with any of the jobid.i as the last submitted job in the spool is not taken by isfrows. I changed my code in many and displayed it but no use the latest submitted job row was not taken by isfrows....
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Apr 22, 2015 12:59 am    Post subject: Reply to: ISFROWS returns 0
Reply with quote

search the forum for may SDSF REXX snippets.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Apr 22, 2015 12:50 pm    Post subject:
Reply with quote

On reflection icon_redface.gif , while this exercise in accessing SDSF from REXX may have some merit, a routine such as this should NEVER be released for use. If the routine submits a job and then keeps executing until the job has ended so it can check return codes &c, it would be extremely wasteful of resources.

If run from a TSO session, it will not only consume CPU wastefully - it will also lock the TSO session, preventing the user from doing productive work. icon_exclaim.gif

Garry
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Wed Apr 22, 2015 5:13 pm    Post subject:
Reply with quote

Quote:
On reflection , while this exercise in accessing SDSF from REXX may have some merit, a routine such as this should NEVER be released for use.

I completely agree with Garry, I have been looking at the little technicalities of things and missed the whole picture of waiting for a batch job to complete while the session is locked up on a REXX.

I believe this is one of things that could be done, but should not be done.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed Apr 22, 2015 6:00 pm    Post subject:
Reply with quote

Garry Carroll wrote:

If run from a TSO session, it will not only consume CPU wastefully - it will also lock the TSO session, preventing the user from doing productive work. icon_exclaim.gif

Garry


I dint find any other option other than this as the job should be executed at the background. I have used ISFACT to get the return code and now it is working fine. Also I have used rexx sleep manually for 5 like

Code:

ADDRESS SYSCALL
"SLEEP" 5


but sometimes the job might take long time to execute. As i dint find anyother option i used this. Do you have any idea about this....?
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed Apr 22, 2015 6:03 pm    Post subject:
Reply with quote

vasanthz wrote:
Quote:
On reflection , while this exercise in accessing SDSF from REXX may have some merit, a routine such as this should NEVER be released for use.

I completely agree with Garry, I have been looking at the little technicalities of things and missed the whole picture of waiting for a batch job to complete while the session is locked up on a REXX.

I believe this is one of things that could be done, but should not be done.


Do you mean that two person cannot execute the Rexx code that is using the job at the same time.....??
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 989
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Apr 22, 2015 6:17 pm    Post subject:
Reply with quote

No, that is not what is meant. What I'm getting at is the effects of running this REXX:

1. while your TSO session is executing the REXX code, you are unable to do anything else in that TSO session

2. while the submitted job is running, it is using one processor while the 'locked' TSO session is using another in an indefinite loop - there is no facility to suspend execution of the REXX on z/OS until the submitted job completes, or for the submitted job to 'wake' your REXX on completion

In both cases, the TSO session is wasting CPU resources. You may be able to use your time doing other non-TSO work, but then you might miss when the job completes. The waste of resources increases with every user who uses this functionality - which will affect all users, batch jobs and online systems across any PLEX which shares the processors - including, probably the production system.

Garry icon_rolleyes.gif
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed Apr 22, 2015 6:22 pm    Post subject:
Reply with quote

Garry Carroll wrote:
No, that is not what is meant. What I'm getting at is the effects of running this REXX:

1. while your TSO session is executing the REXX code, you are unable to do anything else in that TSO session

2. while the submitted job is running, it is using one processor while the 'locked' TSO session is using another in an indefinite loop - there is no facility to suspend execution of the REXX on z/OS until the submitted job completes, or for the submitted job to 'wake' your REXX on completion

In both cases, the TSO session is wasting CPU resources. You may be able to use your time doing other non-TSO work, but then you might miss when the job completes. The waste of resources increases with every user who uses this functionality - which will affect all users, batch jobs and online systems across any PLEX which shares the processors - including, probably the production system.

Garry icon_rolleyes.gif



But there is no other option right...? This happens commonly when ever we run the rexx code ...The other thing here is the Job execution is also increasing cpu time as it has to complete its execution. But when the job has to be submitted internally I thought this would be the easy way [i.e execute the job through REXX ]
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFHRESPONSE returns issue divated CICS 3 Wed Nov 02, 2016 6:32 pm
No new posts GetObjectArrayElement returns NULL Majid Hussain Java & MQSeries 2 Wed Mar 30, 2016 2:59 am
No new posts LINK , START, ATI control returns kiraj CICS 9 Fri Aug 09, 2013 9:29 pm
No new posts LMMLIST COMMAND returns with RC = 8 Pedro TSO/ISPF 14 Wed Apr 03, 2013 6:46 pm
No new posts Update query returns -905 due to ASUT... jramuk DB2 9 Wed Nov 28, 2012 2:28 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us