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

Calling macro via rexx in batch mode.


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
SanaR

New User


Joined: 04 Feb 2016
Posts: 15
Location: Lithuania

PostPosted: Tue Mar 08, 2016 4:46 pm
Reply with quote

Hi All,

I am trying to run a macro via rexx in batch mode:

Code:

/* REXX
*/

Address TSO /* allocate macro library */
"ALTLIB ACTIVATE APP(EXEC) DA('USUXXX.XXX12940.REXXLIB')"


trace r
SAY "Calling PARTCNT1"
dsn = "USU.XXXXXX11.XXXXXXTS.DFROMIC"
"ISPEXEC VIEW DATASET('"dsn"') MACRO(PARTCNT1)"

SAY "<<<<<<PART MACRO WAS CALLED>>>>>>"

Address TSO /* Deactivate macro library */
"ALTLIB DEACTIVATE APP(EXEC)"

EXIT 0


Code:
/* MACRO */
ADDRESS ISREDIT
"MACRO"
TRACE R

POS1 = 1
POS2 = 350000
POS3 = 1100000
POS4 = LAST

"(LVAL1) = LINE "POS1; "SEEK ALL "LVAL1; "(LCNT1) = SEEK_COUNTS"
"(LVAL2) = LINE "POS2; "SEEK ALL "LVAL2; "(LCNT2) = SEEK_COUNTS"
"(LVAL3) = LINE "POS3; "SEEK ALL "LVAL3; "(LCNT3) = SEEK_COUNTS"

"(LASTL) = LINENUM .ZLAST"
"(LVAL4) = LINE "LASTL;   "SEEK ALL "LVAL4; "(LCNT4) = SEEK_COUNTS"

SAY "POS;CRD_NUMBER;CRD_COUNT"
SAY LEFT(POS1,15,' ')";'"LVAL1"';"LCNT1
SAY LEFT(POS2,15,' ')";'"LVAL2"';"LCNT2
SAY LEFT(POS3,15,' ')";'"LVAL3"';"LCNT3
SAY LEFT(POS4'='LASTL,15,' ')";'"LVAL4"';"LCNT4
"ISREDIT SAVE"
"ISREDIT END"



The JCL runs ok but the report that the above macro is created to produce is not returned in the job output.
The rexx and macro runs fine online.
Can anyone please suggest?

The JCL is as follows:
Code:

//S01     EXEC PGM=IKJEFT01,COND=(4,LT)
//SYSTSPRT DD  SYSOUT=*
//ISPLOG   DD  SYSOUT=*,RECFM=VA,LRECL=125,BLKSIZE=129
//ISPPLIB  DD  DSN=SPF.ISPPLIB,DISP=SHR
//         DD  DSN=SX1.SISPPLIB,DISP=SHR
//ISPMLIB  DD  DSN=SPF.ISPMLIB,DISP=SHR
//         DD  DSN=SX.SISPMENU,DISP=SHR
//         DD  DSN=SX.SBLSMSG0,DISP=SHR
//ISPTLIB  DD  DSN=SX.SISPTENU,DISP=SHR
//ISPSLIB  DD  DSN=SPF.ISPSLIB,DISP=SHR
//ISPPROF  DD  DSN=USXXX1.BATCH.SPF.PROFILE,DISP=SHR
//SYSPROC  DD  DSN=USXXX1.XXXXX940.REXXLIB,DISP=SHR
//SYSEXEC  DD  DSN=USXXX1.XXXXX940.REXXLIB,DISP=SHR
//SYSTSIN  DD  *
 ISPSTART CMD(%CALLPART)
/*
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Mar 08, 2016 4:55 pm
Reply with quote

Have you given up on your SORT question?
Back to top
View user's profile Send private message
SanaR

New User


Joined: 04 Feb 2016
Posts: 15
Location: Lithuania

PostPosted: Tue Mar 08, 2016 4:59 pm
Reply with quote

Yes icon_sad.gif
Back to top
View user's profile Send private message
SanaR

New User


Joined: 04 Feb 2016
Posts: 15
Location: Lithuania

PostPosted: Tue Mar 08, 2016 5:00 pm
Reply with quote

But for the time being due to limited timescale.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Tue Mar 08, 2016 8:41 pm
Reply with quote

What do you mean by 'report that the above macro is created to produce is not returned in the job output.' - the SAYs?
I did a quick test and I see all the SAYs.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Mar 08, 2016 8:48 pm
Reply with quote

You are invoking this 'edit' macro with an "ISPEXEC VIEW....
You probably do not want an "ISREDIT SAVE" in your macro.

Additionally, in your JCL you have SYSTSPRT=*
What is the MSGCLASS on your Job card?
Back to top
View user's profile Send private message
SanaR

New User


Joined: 04 Feb 2016
Posts: 15
Location: Lithuania

PostPosted: Tue Mar 08, 2016 8:52 pm
Reply with quote

Thanks Willy for your reply. Did you run it via JCL ? Can I see what did you use and what output you got?
Back to top
View user's profile Send private message
SanaR

New User


Joined: 04 Feb 2016
Posts: 15
Location: Lithuania

PostPosted: Tue Mar 08, 2016 8:55 pm
Reply with quote

Thanks Dave for your reply. I have changed the code from SAVE to CANCEL now but it still doesn't give any out.

Is SYSTSPRT=* wrong? Should I remove it?

MSGCLASS=X
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Tue Mar 08, 2016 9:05 pm
Reply with quote

Well the =* part says to use the same class as the MSGCLASS.

In our shop MSGCLASS=X sends the output to the 'bit bucket' aka garbage, where it will never be seen.

If you are not seeing ANY output, then you want a different MSGCLASS.

What is the HOLD class at your shop?

Additionally, if you have ISREDIT CANCEL, then you do not need the ISREDIT END afterward it.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Tue Mar 08, 2016 9:22 pm
Reply with quote

JCL...
Code:
//BE       EXEC PGM=IKJEFT1B,PARM='ISPSTART CMD(%zispedt1)'     
//SYSEXEC  DD DISP=SHR,DSN=WJ.LIB.EXEC                           
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU                         
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU                         
//ISPSLIB  DD DISP=SHR,DSN=ISP.SISPSENU                         
//ISPTLIB  DD DISP=SHR,DSN=ISP.SISPTENU                         
//ISPPROF  DD UNIT=SYSDA,SPACE=(TRK,(5,5,5)),RECFM=FB,LRECL=80   
//ISPLOG   DD DUMMY SYSOUT=*,RECFM=VA,LRECL=125,BLKSIZE=129     
//ISPFILE  DD SYSOUT=*,RECFM=FB,LRECL=80,BLKSIZE=6240           
//SYSTSPRT DD SYSOUT=*                                           
//SYSTSIN  DD DUMMY


ZISPEDT1....
Code:
 /* rexx */                                                       
  trace r                                                         
  address tso "altlib act app(exec) da('WJ.DEZHI.EXEC')"           
  address ispexec "view dataset('WJ.LIB.CNTL(ZZ)') macro(zispedt2)"
  address tso "altlib deact app(exec)"                             
  trace off                                                       

ZISPEDT1....
A copy of you 2nd REXX.

Output extract, tons of error messages as my data is different from yours...
Code:
 *-* address tso "altlib act app(exec) da('WJ.DEZHI.EXEC')"               
 >>>   "altlib act app(exec) da('WJ.DEZHI.EXEC')"                         
 *-* address ispexec "view dataset('WJ.LIB.CNTL(ZZ)') macro(zispedt2)"     
 >>>   "view dataset('WJ.LIB.CNTL(ZZ)') macro(zispedt2)"                   
 *-* POS1 = 1                                                             
 >>>   "1"                                                                 
 *-* POS2 = 350000                                                         
 >>>   "350000"                                                           
 *-* POS3 = 1100000                                                       
 >>>   "1100000"                                                           
 *-* POS4 = LAST                                                           
 >>>   "LAST"                                                             
 *-* "(LVAL1) = LINE "POS1                                                 
 >>>   "(LVAL1) = LINE 1"                                                 
 *-* "SEEK ALL "LVAL1                                                     
 >>>   "SEEK ALL         DC CL12'04 Alfa      '                           
 +++ RC(28) +++                                                           
 *-* "(LCNT1) = SEEK_COUNTS"                                               
 >>>   "(LCNT1) = SEEK_COUNTS"                                             
 +++ RC(28) +++                                                           
 *-* "(LVAL2) = LINE "POS2                                                 
 >>>   "(LVAL2) = LINE 350000"                                             
 +++ RC(28) +++                                                           
 *-* "SEEK ALL "LVAL2                                                     
 >>>   "SEEK ALL " 


Re MSGCLASS, if you see output from job JCL / JOBLOG all then msgclass is ok.
Back to top
View user's profile Send private message
SanaR

New User


Joined: 04 Feb 2016
Posts: 15
Location: Lithuania

PostPosted: Wed Mar 09, 2016 1:19 pm
Reply with quote

Hi Will,

Thanks for your reply.

I tried using the exact same JCL as yours but I am not able to see any output

Code:
********************************* TOP OF D
<<<<<<PART MACRO WAS CALLED>>>>>>
READY
END
******************************** BOTTOM O
Back to top
View user's profile Send private message
SanaR

New User


Joined: 04 Feb 2016
Posts: 15
Location: Lithuania

PostPosted: Wed Mar 09, 2016 1:20 pm
Reply with quote

Just to let you know the input file is FB, 20 bytes and record key in 1-19.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Wed Mar 09, 2016 1:58 pm
Reply with quote

Are you sure that the calling REXX CALLPART in 'USXXX1.XXXXX940.REXXLIB' is the one you listed? You get the SAY output but not the trace. Not sure it matters, but I would remove the SYSPROC DD.
Back to top
View user's profile Send private message
SanaR

New User


Joined: 04 Feb 2016
Posts: 15
Location: Lithuania

PostPosted: Wed Mar 09, 2016 2:16 pm
Reply with quote

Hi Willy.

I had removed the trace that's why I was just getting the SAY msg. I have tried running it without SYSPROC but no use icon_sad.gif. May I request you to run your job with a sample file of FB,20 bytes and record key in 1-19.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Wed Mar 09, 2016 3:00 pm
Reply with quote

Can y'all please use the code tags when posting code, data, screen extracts? Thank you.

BTW: you can edit your posts for up to 10 minutes after posting. That would have saved a couple of the edits that I did.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Thu Mar 10, 2016 4:01 pm
Reply with quote

The file structure is irrelevant, only contents matter in your example. I did another small test with data which matches your logic, as I understand it, and I get a report displayed. Now I have to ask, do you get output from TRACE R in the PARTCNT1 pgm? I suggest that you put the TRACE R right after the top label.
Is your input file really 1.1 m+ records?

@Nic. sorry, will try to remember those tags.[/code]
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts MacKinney Batch to CICS upgrade causi... CICS 7
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts Excuting store procedure via JCL batch JCL & VSAM 1
Search our Forums:

Back to Top