IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Output mismatch while running a exec thriugh jcl


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
easebourne_ironfist

New User


Joined: 04 Mar 2013
Posts: 13
Location: Hyderabad

PostPosted: Sat Jul 27, 2013 3:47 pm
Reply with quote

Hi all ,
I am having a terible time trying to understand the diffrent out put i am getting while running an exec through jcl and when runing it directly by giving "exec" command . My codes requirments
Read a pds .
find its memebers .
List out steps that have a particular string
get the last modified date of the memers

i am getting all the things right . the last requirment of getting the last modified date is showing diffrent result when i am running the job using a "RUNJCL" and that when running it using "EXEC" command .Below is my code

Code:
/*REXX*/                                                                00010000
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"                                 00010200
                                                                        00020000
PDSNAME="'TEST.PDS'"                                       00030000
SRCHSTRING="PGM=FOCUS"                                                  00040000
COMMENT = "//*"                                                         00050000
/**----------------------------------------------------------------**/  00060000
CALL OUTTRAP "MBRS."                                                    00070000
/**----------------------------------------------------------------**/  00080000
"LISTD" PDSNAME "MEMBERS"                                               00090000
/**----------------------------------------------------------------**/  00100000
CALL OUTTRAP "OFF"                                                      00110000
/**----------------------------------------------------------------**/  00120000
/**IDENTIFY POINT AT WHICH HE MEMEBR LIST STARTS                   **/  00130000
/**THIS WIOLL BE THE VALUE IN NDX                                  **/  00140000
/**----------------------------------------------------------------**/  00150000
/**----------------------------------------------------------------**/  00160000
DO NDX=1 TO MBRS.0                                                      00170000
    IF MBRS.NDX = "--MEMBERS--" THEN LEAVE                              00180000
END                                                                     00190000
NDX=NDX+1                                                               00200000
/**-----------------------------------------------------------------**/ 00210000
/**CONVERT THE PDSNAME TO MAKE SURE IT IS FULLY QUALIFIED           **/ 00220000
/**THIS ADDS THE HIGH LEVEL QUALIFIER,IF NEEDED                     **/ 00230000
/**-----------------------------------------------------------------**/ 00240000
CALL LISTDSI PDSNAME                                                    00250000
F=1                                                                     00260000
say "MEMNAME: ³³STEPNAME:³³MODIFIED:  "                                 00270000
FULLNAME=SYSDSNAME                                                      00280000
 DO CURMBR = NDX TO MBRS.0                                              00290000
    PARSE VALUE MBRS.CURMBR WITH MEMNAME                                00300000
    MEMNAME=STRIP(MEMNAME)                                              00310000
       RECID=1                                                          00320000
       "ALLOC F(XXIN) DS('"fullname"("MEMNAME")') SHR REUSE"            00330000
       "EXECIO * DISKRU XXIN (FINIS STEM IN."                           00340000
        FOUND =0                                                        00350000
        S =0                                                            00360000
       DO RECID=1 to IN.0                                               00370000
         IF POS(SRCHSTRING,IN.RECID) > 0 THEN                           00380000
           IF  POS(COMMENT,IN.RECID) ==1  then                          00390000
            nop                                                         00400000
           ELSE                                                         00410000
            DO                                                          00420000
             STEPNAME =SUBSTR(IN.RECID,3,8)                             00430000
             ZLMDATE=""                                                 00440000
 ADDRESS "ISPEXEC"                                                      00441000
 ADDRESS ISPEXEC "LMINIT DATAID(dataid) DATASET('"FULLNAME"') ENQ(SHR)" 00443000
 ADDRESS ISPEXEC "LMOPEN  DATAID("dataid") OPTION(INPUT)"               00444000
 ADDRESS ISPEXEC "LMMFIND DATAID("dataid") MEMBER("MEMNAME") STATS(YES)"00450000
 ADDRESS ISPEXEC "LMFREE  DATAID("dataid")"                             00460000
                                                                        00481000
    PARSE VAR ZLMDATE YY 3 4 MM 6 7 DD                                  00490000
    MDATE=MM"/"DD"/"YY                                                  00500000
 say JUSTIFY(MEMNAME,9)³³JUSTIFY(STEPNAME,9)³³JUSTIFY(MDATE,11)         00520000
 END                                                                    00530000
END                                                                     00540000
END                                                                     00550000



The output when running the code using EXEC command is correct and what i require .Its as mentioned below
MEMNAME: ||STEPNAME:||MODIFIED:
S10358AA STEP01 04/25/13

But when i run it using jcl it gives this in sysout
2 *-* ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
+++ RC(-3) +++
MEMNAME: ||STEPNAME:||MODIFIED:
47 *-* ADDRESS ISPEXEC "LMINIT DATAID(dataid) DATASET('"FULLNAME"') ENQ
+++ RC(-3) +++
48 *-* ADDRESS ISPEXEC "LMOPEN DATAID("dataid") OPTION(INPUT)"
+++ RC(-3) +++
49 *-* ADDRESS ISPEXEC "LMMFIND DATAID("dataid") MEMBER("MEMNAME") STAT
+++ RC(-3) +++
50 *-* ADDRESS ISPEXEC "LMFREE DATAID("dataid")"
+++ RC(-3) +++

Can somebody help me with this . I need to get the output in the spool sysout .
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Sat Jul 27, 2013 5:57 pm
Reply with quote

You appear to be running background TSO, not background ISPF; this is the cause of RC=-3 whenever you invoke an ISPF service. Ensure that all the ISPF libraries are allocated in the JCL, and invoke your exec by specifying ISPSTART(exec-name) in SYSTSIN.
Back to top
View user's profile Send private message
easebourne_ironfist

New User


Joined: 04 Mar 2013
Posts: 13
Location: Hyderabad

PostPosted: Mon Jul 29, 2013 11:21 am
Reply with quote

Thanks a lot Akatsukami
Learned a new thing today icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts JCL EXEC PARM data in C Java & MQSeries 2
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top