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
 

 

INZUTILB using rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Venkat1001

New User


Joined: 25 Feb 2008
Posts: 12
Location: chennai

PostPosted: Tue Feb 01, 2011 6:26 pm    Post subject: INZUTILB using rexx
Reply with quote

Does any one know how to call INZUTILB utility in rexx?
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Feb 01, 2011 6:40 pm    Post subject: Reply to: INZUTILB using rexx
Reply with quote

If youn REXX exec is running in a TSO address space, then, from what I can tell, you'd do it the same way you would from a TSO prompt.
Back to top
View user's profile Send private message
Venkat1001

New User


Joined: 25 Feb 2008
Posts: 12
Location: chennai

PostPosted: Tue Feb 01, 2011 10:30 pm    Post subject: Reply to: INZUTILB using rexx
Reply with quote

thnx. I was trying this command
ADDRESS TSO
"CALL 'DB2D.PSYSB.P.D01G.SINZLINK(INZUTILB)' 'D01G' "
SAY 'RC AFTER CALL' RC
but getting rc=16.
I have allocated this library to steplib also but no luck.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Feb 01, 2011 10:41 pm    Post subject:
Reply with quote

Did you allocate all the needed DD statements?

See this link on how they ran it from batch.

http://ibmmainframes.com/about45829.html
Back to top
View user's profile Send private message
Venkat1001

New User


Joined: 25 Feb 2008
Posts: 12
Location: chennai

PostPosted: Tue Feb 01, 2011 10:50 pm    Post subject: Reply to: INZUTILB using rexx
Reply with quote

yes i did. Please find my code below.
DSN1 = 'R008534.DEXTB.HELLOT1';
DSN2 = 'R008534.DEXTB.HELLOT2';
DSN4 = 'R008534.DEXTB.HELLOT4';
DSN3 = 'R008534.DEXTB.HELLOT3';
K = SYSDSN("'"DSN1"'")
IF K = 'OK' THEN
"ALLOC DD(SYSIN) DA('"DSN1"') SHR REUSE"
ELSE
"ALLOC DD(SYSIN) DA('"DSN1"') NEW DSORG(PS)",
"RECFM(F B) LRECL(80) SPACE(1,1)";
K = SYSDSN("'"DSN2"'")
IF K = 'OK' THEN
"ALLOC DD(SYSPRINT) DA('"DSN2"') SHR REUSE"
ELSE
"ALLOC DD(SYSPRINT) DA('"DSN2"') NEW DSORG(PS)",
"RECFM(F B) LRECL(80) SPACE(1,1)";
K = SYSDSN("'"DSN3"'")
IF K = 'OK' THEN
"ALLOC DD(MYOUT) DA('"DSN3"') SHR REUSE"
ELSE
"ALLOC DD(MYOUT) DA('"DSN3"') NEW DSORG(PS)",
"CYL RECFM(F B) LRECL(80) SPACE(500,500)";
SAY 1
SAY 2
SQL.1 = "UNLOAD TABLESPACE CAADB026.CAATS399 "
SQL.2 = " DB2 NO "
SQL.3 = " QUIESCE NO QUIESCECAT NO "
SQL.4 = " LOCK NO "
SQL.5 = " SELECT "
SQL.6 = " MSG_ID "
SQL.7 = " ,VERSION_ID "
SQL.8 = " ,INPUT_OUTPUT_IND "
SQL.9 = " FROM CAADB026.CAA_MSG_SIM "
SQL.10= "OUTDDN (MYOUT) "
SQL.11= "FORMAT DSNTIAUL "
SQL.0 = 11
SAY 3
"EXECIO * DISKW SYSIN (STEM SQL. FINIS)"
ADDRESS TSO
DSN6= 'DB2D.PSYSB.P.D01G.SINZLINK('||INZUTILB||')'
"CALL '"DSN6"' 'D01G'"
SAY 'RC AFTER CALL' RC
SAY 123
"FREE F(SYSIN SYSPRINT MYOUT )";
exit
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Feb 01, 2011 10:57 pm    Post subject:
Reply with quote

Hello,

What is shown when you run a trace?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Feb 01, 2011 10:58 pm    Post subject:
Reply with quote

Did you get this to work in Batch (without rexx)?

I would try to do that first.

I would also make sure all the DDs required in batch are allocted in your rexx.
Back to top
View user's profile Send private message
Venkat1001

New User


Joined: 25 Feb 2008
Posts: 12
Location: chennai

PostPosted: Tue Feb 01, 2011 11:06 pm    Post subject: Reply to: INZUTILB using rexx
Reply with quote

Other than this i dont see any error
>O> "CALL 'DB2D.PSYSB.P.D01G.SINZLINK(INZUTILB)' 'D01G'"
+++ RC(16) +++
Back to top
View user's profile Send private message
Venkat1001

New User


Joined: 25 Feb 2008
Posts: 12
Location: chennai

PostPosted: Tue Feb 01, 2011 11:08 pm    Post subject: Reply to: INZUTILB using rexx
Reply with quote

It works in batch but i want to run this utility using Rexx.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Feb 01, 2011 11:48 pm    Post subject:
Reply with quote

So what does your JCL for your batch run look like?

Does the results of the run show in one of the DDs there?

What does the results in the same DD look like in you Rexx run?

Do you get where I am going with this?
Back to top
View user's profile Send private message
Venkat1001

New User


Joined: 25 Feb 2008
Posts: 12
Location: chennai

PostPosted: Wed Feb 02, 2011 12:34 am    Post subject: Reply to: INZUTILB using rexx
Reply with quote

Yes. When i submit through jcl i use PGM=INZUTILB and it works fine.
But when i call the same program though rexx it gives me some error.
I think since INZUTILB is assembly langauge program rexx is giving some error(not sure).
The below is my batch jcl
//CAAPS010 EXEC PGM=INZUTILB,REGION=0M,DYNAMNBR=99,
// PARM='D01G'
//*
//STEPLIB DD DSN=DB2D.PSYSB.P.D01G.SINZLINK,DISP=SHR
// DD DSN=DB2D.PSYSB.P.D01G.SDSNEXIT,DISP=SHR
// DD DSN=DB2D.PSYSB.P.D01G.SDSNLOAD,DISP=SHR
//*
//MYOUT DD DSN=R008534.SEXTB.CAAHPU05.DB18.TC01,
// DISP=(NEW,CATLG,KEEP),
// SPACE=(CYL,(500,500),RLSE),
// UNIT=SYSDA,BUFNO=30
//*
//*
//SYSPRINT DD DSN=R008534.DEXTB.HELLOT2,DISP=SHR
//SYSIN DD DSN=R008534.DEXTB.HELLOT1,DISP=SHR
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Feb 02, 2011 12:42 am    Post subject:
Reply with quote

Make sure your STEPLIB DD is allocated to all three libraries above.

Try changing your call to "CALL *(INZUTILB)"
Back to top
View user's profile Send private message
Venkat1001

New User


Joined: 25 Feb 2008
Posts: 12
Location: chennai

PostPosted: Wed Feb 02, 2011 1:25 am    Post subject: Reply to: INZUTILB using rexx
Reply with quote

it didnt work.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Feb 02, 2011 1:46 am    Post subject:
Reply with quote

Hello,

Then you'd best fix it. . .

If you want help, you cannot post "if didn't work". This is just a waste of everyone's time.

Post the code that fails but has the proper steplib datasets allocated.
Back to top
View user's profile Send private message
Venkat1001

New User


Joined: 25 Feb 2008
Posts: 12
Location: chennai

PostPosted: Wed Feb 02, 2011 2:19 am    Post subject: Reply to: INZUTILB using rexx
Reply with quote

Please find my code below. I am also attaching the trace
Code:

/* REXX */                                                                                         
TRACE '?i'                                                   
DSN1 = 'R008534.DEXTB.HELLOT1';                                     
DSN2 = 'R008534.DEXTB.HELLOT2';                                     
DSN3 = 'R008534.DEXTB.HELLOT3';                                     
DSN4 = 'R008534.DEXTB.HELLOT4';                                     
DSN5 = 'R008534.DEXTB.HELLOT9';                                     
DSN6 = 'R008534.DEXTB.HELLOT6';                                     
DSN7 = 'R008534.DEXTB.HELLOT7';                                     
DSN8 = 'R008534.DEXTB.HELLOT8';                                     
DSN9 = 'R008534.DEXTB.HELLOT9';                                     
K = SYSDSN("'"DSN1"'")                                               
IF K = 'OK' THEN                                 
  "ALLOC DD(SYSIN) DA('"DSN1"') SHR REUSE"         
ELSE                                             
  "ALLOC DD(SYSIN) DA('"DSN1"') NEW DSORG(PS)",   
  "RECFM(F B) LRECL(80) SPACE(1,1)";               
K = SYSDSN("'"DSN2"'")                           
IF K = 'OK' THEN                                 
  "ALLOC DD(SYSPRINT) DA('"DSN2"') SHR REUSE"     
ELSE                                             
  "ALLOC DD(SYSPRINT) DA('"DSN2"') NEW DSORG(PS)",
  "RECFM(F B) LRECL(80) SPACE(1,1)";               
K = SYSDSN("'"DSN3"'")                           
IF K = 'OK' THEN                                 
  "ALLOC DD(MYOUT) DA('"DSN3"') SHR REUSE"         
ELSE                                             
  "ALLOC DD(MYOUT) DA('"DSN3"') NEW DSORG(PS)",   
  "RECFM(F B) LRECL(80) SPACE(1,1)";               
K = SYSDSN("'"DSN5"'")                           
IF K = 'OK' THEN                                           
  "ALLOC DD(SYSTSPRT) DA('"DSN5"') SHR REUSE"                 
ELSE                                                       
  "ALLOC DD(SYSTSPRT) DA('"DSN5"') NEW DSORG(PS)",           
  "RECFM(F B) LRECL(80) SPACE(1,1)";                         
K = SYSDSN("'"DSN6"'")                                     
IF K = 'OK' THEN                                           
  "ALLOC DD(SYSDBOUT) DA('"DSN6"') SHR REUSE"                 
ELSE                                                       
  "ALLOC DD(SYSDBOUT) DA('"DSN6"') NEW DSORG(PS)",           
  "RECFM(F B) LRECL(80) SPACE(1,1)";                         
K = SYSDSN("'"DSN7"'")                                     
IF K = 'OK' THEN                                           
  "ALLOC DD(SYSOUT) DA('"DSN7"') SHR REUSE"                   
ELSE                                                       
  "ALLOC DD(SYSOUT) DA('"DSN7"') NEW DSORG(PS)",             
  "RECFM(F B) LRECL(80) SPACE(1,1)";                         
K = SYSDSN("'"DSN8"'")                                     
IF K = 'OK' THEN                                                   
  "ALLOC DD(SYSUDUMP) DA('"DSN8"') SHR REUSE"                         
ELSE                                                               
  "ALLOC DD(SYSUDUMP) DA('"DSN8"') NEW DSORG(PS)",                   
  "RECFM(F B) LRECL(80) SPACE(1,1)";                                 
                                                             
SQL.1 = "   UNLOAD TABLESPACE CAADB026.CAATS399        "           
SQL.2 = "    DB2 NO                                    "           
SQL.3 = "    QUIESCE NO QUIESCECAT NO                  "           
SQL.4 = "     LOCK NO                                   "           
SQL.5 = "       SELECT                              "               
SQL.6 = "             MSG_ID                        "               
SQL.7 = "            ,VERSION_ID                    "               
SQL.8 = "            ,INPUT_OUTPUT_IND              "               
SQL.9 = "       FROM       CAADB026.CAA_MSG_SIM     "               
SQL.10= "    OUTDDN (MYOUT)                             "           
SQL.11= "     FORMAT DSNTIAUL                            "         
SQL.11= "     FORMAT DSNTIAUL                            "             
SQL.0 = 11                                                             
                                                           
"EXECIO * DISKW SYSIN (STEM SQL. FINIS)"                                         
"CALL *(INZUTILB) 'D01G'"                                               
SAY 'RC AFTER CALL' RC                                                 
"CALL *(INZUTILB) "                                                     
SAY 'RC AFTER CALL' RC                                                 
                                                               
"FREE F(SYSIN SYSPRINT MYOUT SYSUDUMP SYSTSPRT SYSDBOUT SYSOUT )"
exit
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Wed Feb 02, 2011 2:27 am    Post subject:
Reply with quote

Quote:
"STEPLIB ('DB2D.PSYSB.P.D01G.SINZLINK' " ||,
"'DB2D.PSYSB.P.D01G.SDSNLOAD' " ||,
"'DB2D.PSYSB.P.D01G.SDSNEXIT' ) "

Does this command really allocate your steplib?

I have never seen it done that way.

I have a feeling this may be part of your problem.

Your allocate to steplib needs to be done the same way you are allocating your other DDs.

Please use code tag in the future for all input and output. See how nice this sample looks:
Code:

* REXX */
/*"ISPEXEC CONTROL ERRORS RETURN"*/
TRACE '?i'
ADDRESS TSO
"STEPLIB ('DB2D.PSYSB.P.D01G.SINZLINK' " ||,
"'DB2D.PSYSB.P.D01G.SDSNLOAD' " ||,
"'DB2D.PSYSB.P.D01G.SDSNEXIT' ) "
SAY RC
DSN1 = 'R008534.DEXTB.HELLOT1';
DSN2 = 'R008534.DEXTB.HELLOT2';
DSN3 = 'R008534.DEXTB.HELLOT3';
DSN4 = 'R008534.DEXTB.HELLOT4';
DSN5 = 'R008534.DEXTB.HELLOT9';
DSN6 = 'R008534.DEXTB.HELLOT6';
DSN7 = 'R008534.DEXTB.HELLOT7';
DSN8 = 'R008534.DEXTB.HELLOT8';
DSN9 = 'R008534.DEXTB.HELLOT9';
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Feb 02, 2011 2:40 am    Post subject:
Reply with quote

Hello,

Quote:
Does this command really allocate your steplib?

I have never seen it done that way.
I've not either.

Something to consider is that just because "something" results in an rc=0, this does not mean the "thing" did what was wanted. . . It was merely acceptable (or not rejected) by the system.
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Wed Feb 02, 2011 4:28 am    Post subject:
Reply with quote

What part of this did you not understand.

"Make sure your STEPLIB DD is allocated to all three libraries above"

Code:

"ALLOC FI(STEPLIB) DA('DB2D.PSYSB.P.D01G.SINZLINK',",
                     "'DB2D.PSYSB.P.D01G.SDSNEXIT',",
                     "'DB2D.PSYSB.P.D01G.SDSNLOAD')",
                     " SHR REUSE"
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Feb 02, 2011 4:46 am    Post subject: Reply to: INZUTILB using rexx
Reply with quote

the steplib <thing> might be a legal command...
there are add on tools some of them free other for a fee
that provide a dynamic steplib facility.

You cannot allocate a steplib under TSO
the steplib is allocated before the program in the stepp gets executed

to allocate dynamically a steplib there is quite a bit od control block mangling to be done
but if the tool is written in the proper way it works very well.

so
Code:
Address TSO "STEPLIB ('DB2D.PSYSB.P.D01G.SINZLINK' " ||,
"'DB2D.PSYSB.P.D01G.SDSNLOAD' " ||,
"'DB2D.PSYSB.P.D01G.SDSNEXIT' ) "

might work

Code:
"ALLOC FI(STEPLIB) DA('DB2D.PSYSB.P.D01G.SINZLINK',",
                     "'DB2D.PSYSB.P.D01G.SDSNEXIT',",
                     "'DB2D.PSYSB.P.D01G.SDSNLOAD')",
                     " SHR REUSE"

certainly not!

http://www.tsotimes.com/articles/current/summer04/TSO_Times_Tips.htm
http://gsf-soft.com/Products/STEPLIB.shtml
http://www.cbttape.org/ftp/cbt/CBT452.zip
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Feb 02, 2011 8:25 am    Post subject:
Reply with quote

Hello,

Is this rexx to run under tso in batch?

If it is, the tso joblib/steplib could be changed to include these datasets.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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