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

Need to allocate SDSNLOAD for DSNREXX NDM RUN TASK


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Tue Nov 06, 2018 4:55 am
Reply with quote

I am trying to run a rexx db2 program as an NDM Run task
it is not working right now because i cannot figure out how to allocate the SDSNLOAD
Does anyone know how to do this?

NDM proc
Code:

CKCOPYRC PROCESS SNODE=DEL -                                           
   &REXXLIB=HLQ.REXX.LIB -                                   
   &SDSNLOAD=SYS5.DB2.DB2D.SDSNLOAD -                                 
   &PROFILE=JOBNAME -                                                 
   &LASTGEN=HLQ.LEVEL1.LEVEL2                     
/* */                                                                 
/* FREE FILES */                                                       
/* */                                                                 
FREE1 RUN TASK ( PGM=DMRTDYN, PNODE, PARM=( -                         
      C"UNALLOC DDNAME=SYSEXEC" F"-1" -                               
      C"UNALLOC DDNAME=SYSTSIN" F"-1" -                               
      C"UNALLOC DDNAME=SYSTSPRT" ) )                                   
/* */                                                                 
/* ALLOC FILES */                                                     
/* */                                                                 
ALLOC RUN TASK ( PGM=DMRTDYN, PNODE, PARM=( -                         
      C"ALLOC DDNAME=SYSEXEC DISP=SHR DSN=&REXXLIB" F"-1" -           
      C"ALLOC DDNAME=STEPLIB  DISP=SHR DSN=&SDSNLOAD" F"-1" -         
      C"ALLOC DDNAME=SYSTSIN DUMMY" F"-1" -     
      C"ALLOC DDNAME=SYSTSPRT SYSOUT=*" -                             
      C" DCB=(RECFM=FB, LRECL=80 )" ) )                               
/* */                                                                 
REXX RUN TASK ( PGM=IRXJCL, PNODE, -                                   
     PARM=(C"CKCOPYRC &PROFILE &LASTGEN"))                             
/* */                                                                 
/* ISSUE NOTIFY IF RC NOT 0 */                                         
/* */                                                                 
DMNOTIFY IF (REXX <> 0) THEN                                           
     RUN TASK (PGM=DMNOTIFY, PNODE, -                                 
     PARM=('FAIL', CL44"IRXJCL" ))                                     
     EIF                                                               
/* */                                                                 
/* FREE FILES */                                                       
/* */                                                                 
FREE2 RUN TASK ( PGM=DMRTDYN, PNODE, PARM=( -                         
      C"UNALLOC DDNAME=SYSEXEC" F"-1" -                               
      C"UNALLOC DDNAME=SYSTSIN" F"-1" -                               
      C"UNALLOC DDNAME=SYSTSPRT" ) )                                       


Rexx program
Code:

/* rexx */                                                             
parse arg profile lastgen                                               
subsys    = 'DB2D'                                                     
address tso "subcom dsnrexx"                                           
if rc then                                                             
do                                                                     
  s_rc = rxsubcom('add','dsnrexx','dsnrexx')                           
end                                                                     
address dsnrexx                                                         
"connect" subsys                                                       
if sqlcode <> 0 then                                                   
do                                                                     
   say "sqlcode from connect is "sqlcode                               
   exit 12                                                             
end                                                                     
updatels  = "update ccddpgm.transmission_setup",                       
            " set lastgen = ?",                                         
            " where profile = ?"                                       
address dsnrexx                                                         
"execsql prepare s1 from :updatels"                                     
if sqlcode /= 0 then                                                   
    say "sqlcode from prepare update is "sqlcode                       
"execsql execute s1 using :lastgen, :profile"                           
exit sqlcode                                                           


NDM Log
Code:

Function     => RUN TASK (PNODE)     Step Start Time => 18:03:14               
Process Name => CKCOPYRC             Step End Time   => 18:03:14               
Process Num  => 33,486                                                         
                                        Comp Code    => 00000014               
SMFID        => HO42                    Comp Msg     => SRTA005I               
Userid       => ECCCHXS                                                       
Job Name     => ECCCHXSB                Job ID       => JOB40507               
Primary Node => NDMTEST                 Step Name    => REXX                   
Session Class=> 002                                                           
Program name => IRXJCL                                                         
   Parm data => (                                                             
                 \C'CKCOPYRC JOBNAME HLQ.LEVEL1.LEVEL2'\                                             
                )                                                             
  Time on CP => 00:00:00.005                                                   
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Tue Nov 06, 2018 5:22 pm
Reply with quote

I think this is about how to specify the loadlib. I tried various ddnames, none of them worked. there should be a way. i don't this is a very complex issue. I just don't know how to solve it.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Nov 06, 2018 5:34 pm
Reply with quote

what error did You get ???
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Tue Nov 06, 2018 5:56 pm
Reply with quote

it is in the Ndm log that I pasted above
Comp Code => 00000014

SMFID => HO42 Comp Msg => SRTA005I

[/code]
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Nov 06, 2018 6:10 pm
Reply with quote

I have seen that... but it is a completion code at the very end of the process,
it does not tell at what point the process fails

can You try to run with
Code:
Trace "I"


it is a bit verbose but it tells all You might want to know about what happens when You run the script
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Wed Nov 07, 2018 3:55 am
Reply with quote

The message do not get written when I run the rexx as an NDM RUN TASK
I ran basic rexx with no Db2 as NDM RUN TASK - it worked
I also ran the Db2 rexx using IKJEFT01 without using NDM, dropping //JOBLIB DD DISP=SHR,DSN=SYS5.DB2.DB2D.SDSNLOAD
I get the same error
The connect fails
I need to figure out how to allocate SYS5.DB2.DB2D.SDSNLOAD while the rexx is run via NDM Run TAsk
Code:

   >O>   "connect DB2D"                           
   +++ RC(-3) +++                                 
12 *-* if sqlcode <> 0                           
   >L>   "SQLCODE"                               
   >L>   "0"                                     
   >O>   "1"                                     
   *-*  then                                     
13 *-*  do                                       
14 *-*   say "sqlcode from connect is "sqlcode   
   >L>     "sqlcode from connect is "             
   >L>     "SQLCODE"                             
   >O>     "sqlcode from connect is SQLCODE"     
ode from connect is SQLCODE                       
15 *-*   exit sqlcode                             
   >L>     "SQLCODE"                             
[/code]
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Nov 07, 2018 4:30 am
Reply with quote

I never tested using JOBLIB ...

I usually add to the steplib concatenation
Code:

//         DD  DSN=xxxxxxxxxx.SDSNEXIT
//         DD  DSN=xxxxxxxxxx.SDSNLOAD


if Your rexx script runs as a subtask of the NDM started task
You might try to add the db2 datasets to the NDM steplib concatenation
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Wed Nov 07, 2018 5:07 am
Reply with quote

i tried that but it did not work. maybe it would need to be added to the steplib of the NDM started task that keeps NDM up. That would be a long battle that I will lose icon_redface.gif
There should be a way to tell DSNREXX connect to look in a specific loadlib right? Maybe not. I have idea. This would have saved me a lot of trouble if i could get the RUN TASK to update the DB2 table directly.
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Wed Nov 07, 2018 5:09 am
Reply with quote

How about TSOLIB or something? I tried TSOLIB but got an error which said it needs to be run under TSO/E
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Wed Nov 07, 2018 9:17 pm
Reply with quote

If there is a way to run the rexx under TSO/E using IRXJCL or something else I might be able to pull this off
I am not able to run IKJEFT01 as an NDM RUN TASK
Does anyone know how to do this ?
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Wed Nov 07, 2018 9:19 pm
Reply with quote

The following works in batch (not NDM RUN TASK) when run under IKJEFT01
Code:

/* rexx */                                                   
"allocate file(myload) dataset('SYS5.DB2.DB2D.SDSNLOAD') shr"
if rc = 0 then                                               
    push "tsolib activate file(myload)"                       
exit                                                         
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Thu Nov 08, 2018 5:55 am
Reply with quote

DMRTSUB seems to do roughly what i wanted to do
I want to use this for capturing the status of NDM copy steps in a Db2 table
But a separate update job will be run for each COPY. it would have been better if I could use RUN TASK to update the table. Does anyone know of a better way to do this?
Code:

//JSTY020 EXEC INSPCDR2,                                               
//        DSN01='COMM.NDM.V3R2.NETMAP.SA40',                           
//        DSN02='COMM.NDM.MSG'                                         
//PSTY0010.DMPUBLIB DD DISP=SHR,DSN=CSDDLTLX.NDM.PROCESS.LIB           
//PSTY0010.SYSIN    DD *,DLM=ZZ                                         
 SIGNON CASE=YES                                                       
 SUBMIT PROC=REXXRUNT                                                   
 SIGNOFF                                                               
ZZ       


Code:

EDIT       CSDDLTLX.NDM.PROCESS.LIB(REXXRUNT) - 01.03      Columns 00001 00072
Command ===>                                                  Scroll ===> PAGE
****** ***************************** Top of Data ******************************
000001 CKCOPYRC PROCESS SNODE=DEL -                                           
000002    &PROFILE=FPCS#W03 -                                                 
000003    &LASTGEN=CCDDLTQX.TRX.DEFAULT.FPCS#W01.G0003V00                     
000004 RUNUPDT  RUN TASK (PGM=DMRTSUB )                  /* RUNTASK PGM   */ -
000005          SYSOPTS=\'\                              /* START SYSOPTS */ -
000006    "DSN=ECCCHXS.JCLLIB(CCDUPDST),DISP=SHR"        /* DATASET NAME  */ -
000007          "PROFILE &PROFILE"                       /* PARAMETER #1  */ -
000008          "LASTGEN &LASTGEN"                       /* PARAMETER #2  */ -
000009          \'\                                      /* END SYSOPTS   */ -
000010          SNODE                                                         
****** **************************** Bottom of Data ****************************


Code:

VIEW       ECCCHXS.JCLLIB(CCDUPDST) - 01.02                Columns 00001 00072
Command ===>                                                  Scroll ===> PAGE
000012 // SET PROFILE=&PROFILE                                                 
000013 // SET LASTGEN=&LASTGEN                                                 
000014 //JS001000 EXEC PGM=IKJEFT01,                                           
000015 // PARM='CCDUPDST &PROFILE &LASTGEN',                                   
000016 // DYNAMNBR=256                                                         
000017 //SYSPRINT DD SYSOUT=*                                                 
000018 //SYSTSIN  DD DUMMY                                                     
000019 //SYSTSPRT DD SYSOUT=*                                                 
000020 //SYSEXEC  DD DISP=SHR,DSN=CCDDLTLX.IMPL.ISPCLIB                       
000021 //         DD DISP=SHR,DSN=SYS7.ISPCLIB                                 


Code:

// SET PROFILE=FPCS#W03                                                 
// SET LASTGEN=CCDDLTQX.TRX.DEFAULT.FPCS#W01.G0003V00                   
//JS001000 EXEC PGM=IKJEFT01,                                           
// PARM='CCDUPDST &PROFILE &LASTGEN',                                   
// DYNAMNBR=256                                                         
//SYSPRINT DD SYSOUT=*                                                 
//SYSTSIN  DD DUMMY                                                     
//SYSTSPRT DD SYSOUT=*                                                 
//SYSEXEC  DD DISP=SHR,DSN=CCDDLTLX.IMPL.ISPCLIB                       
//         DD DISP=SHR,DSN=SYS7.ISPCLIB                             
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Nov 08, 2018 3:37 pm
Reply with quote

harisukumaran wrote:
...
I get the same error
The connect fails
...
Code:

   >O>   "connect DB2D"                           
   +++ RC(-3) +++                                 
12 *-* if sqlcode <> 0                           
   >L>   "SQLCODE"                               
   >L>   "0"                                     
   >O>   "1"                                     
   *-*  then                                     
13 *-*  do                                       
14 *-*   say "sqlcode from connect is "sqlcode   
   >L>     "sqlcode from connect is "             
   >L>     "SQLCODE"                             
   >O>     "sqlcode from connect is SQLCODE"     
ode from connect is SQLCODE                       
15 *-*   exit sqlcode                             
   >L>     "SQLCODE"                             
[/code]

Am I the only one who thinks that RC(-3) means an ADDRESS DSNREXX is missing ?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Nov 08, 2018 4:27 pm
Reply with quote

probably the TS did not post the whole trace content
in a previous post ...

Code:
address dsnrexx                                                         
"connect" subsys         
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Sat Nov 10, 2018 1:41 am
Reply with quote

That is right, did not post the first few lines of the rexx. sorry. but it was there when i ran it
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Sat Nov 10, 2018 1:46 am
Reply with quote

Code:

 EDIT       CCDDLTLX.IMPL.ISPCLIB(CCDUPDST) - 01.07         Columns 00001 00072
 Command ===>                                                  Scroll ===> PAGE
 ****** ***************************** Top of Data ******************************
 000001 /* rexx */                                                             
 000002 Trace "I"                                                               
 000003 parse arg profile lastgen                                               
 000004 subsys    = 'DB2D'                                                     
 000005 address tso "subcom dsnrexx"                                           
 000006 if rc /=0 then                                                         
 000007 do                                                                     
 000008   s_rc = rxsubcom('add','dsnrexx','dsnrexx')                           
 000009 end                                                                     
 000010 address dsnrexx                                                         
 000011 "connect" subsys                                                       
 000012 if sqlcode <> 0 then                                                   
 000013 do                                                                     
 000014    say "sqlcode from connect is "sqlcode                               
 000015    exit sqlcode                                                         
 000016 end                                                                     
 000017 updatels  = "update ccddpgm.transmission_setup",                       
 000018             " set lastgen = ?",                                         
 000019             " where profile = ?"                                       
000020 address dsnrexx                                                         
000021 "execsql prepare s1 from :updatels"                                     
000022 if sqlcode /= 0 then                                                   
000023     say "sqlcode from prepare update is "sqlcode                       
000024 "execsql execute s1 using :lastgen, :profile"                           
000025 exit sqlcode                                                           
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 75

PostPosted: Sat Nov 10, 2018 1:49 am
Reply with quote

it does not sound like there is any other way other than submit a separate job via: DMRTSUB
Please do let me know if there is one which does not involve changing linklist or NDM library concatenation
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Started task using a generation dataset JCL & VSAM 7
No new posts Batch call online program, EXCI task ... CICS 3
No new posts Run a simple JOB as Started Task All Other Mainframe Topics 4
No new posts dsnrexx fails without error message CLIST & REXX 9
No new posts Is it possible to allocate DA dataset... All Other Mainframe Topics 5
Search our Forums:

Back to Top