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

Rexx code for ICKDSF INIT JOB


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

New User


Joined: 10 Oct 2007
Posts: 2
Location: India

PostPosted: Sat Mar 05, 2011 1:39 pm
Reply with quote

Hello,

I have a requirement where i need to INIT 100 devices. I used the below rexx code and couldn't come up with the right output,

Code:
/*REXX                                                            */ 
TRACE N                                                               
   X = OUTTRAP(OFF)                                                   
   X = OUTTRAP('XX.',,'NOCONCAT')                                     
   ADDRESS TSO "FREE DD(INPUT)"                                       
   "ALLOC DA('PALANS.TEST.REXX') FILE(INPUT) SHR REU"                 
 ADDRESS TSO "FREE DD(INITJCR)"                                       
 ADDRESS TSO "DEL INIT.JCL"                                           
 ADDRESS TSO "ALLOC DD(INITJCR) DS('PALANS.REXX.JOB') NEW TRA SP(5,2)"
QUEUE "//SYSJRST1 JOB (P-1334-Z133),'REST1 VOLS',   "                 
QUEUE "//         CLASS=A,TYPRUN=HOLD,              "                 
QUEUE "//         MSGCLASS=X,                       "                 
QUEUE "//         TIME=(,),                         "                 
QUEUE "//         NOTIFY=&SYSUID                    "                 
QUEUE "//*                                          "                 
   CNT = 0                                                           
   LINE. = ''                                                         
   'EXECIO * DISKW INPUT (FINIS STEM GP.'                             
   "FREE DD(INPUT)"                                                   
   DO I = 1 TO GP.4                                                   
   STEPNA = WORD(GP.I2,1)                                             
   SPUCB = WORD(GP.I3,2)                                               
   SPVOL = WORD(GP.I4,3)                                               
   TGVOL = WORD(GP.I5,4)                                               
 QUEUE "//"STEPNA" EXEC PGM=ICKDSF,PARM='NOREPLYU',REGION=6M  "       
 QUEUE "//SYSPRINT DD SYSOUT=*                          "             
 QUEUE "//SYSIN  DD   *                               "               
 QUEUE "INIT UNIT("SPUCB") VFY("SPVOL") INDEX(0,1,30) VTOC(2,1,90) "   
 QUEUE "VOLUME("TGVOL")                                            "   
 QUEUE "/*                                                         "   
 Q = QUEUED()                                                         
 END                                                                   
 'EXECIO 'Q' DISKW INITJCL (FINIS'                                     
  EXIT 


Where 'PALANS.REXX.JOB' should have the INIT's card created and 'PALANS.TEST.REXX' has the input to the REXX.

When i execute the above code i'm getting the following error message,
20 +++ DO I = 1 TO GP.4
Error running REXXINIT, line 20: Bad arithmetic conversion
A command entered or contained in a CLIST has invalid syntax.

Could anyone pls help me out in getting the error corrected.. I'm new to REXX icon_smile.gif
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Sat Mar 05, 2011 2:29 pm
Reply with quote

Hi,

there are 2 things I would change for starters

Code:
'EXECIO * DISKW INPUT (FINIS STEM GP.'
to
Code:
'EXECIO * DISKR INPUT (FINIS STEM GP.'


and
Code:
DO I = 1 TO GP.4
to
Code:
DO I = 1 TO GP.0



Gerry
Back to top
View user's profile Send private message
saranya palanisamy

New User


Joined: 10 Oct 2007
Posts: 2
Location: India

PostPosted: Sat Mar 05, 2011 2:46 pm
Reply with quote

Sir,

I have tried your updates in my REXX code and still i get the error message,

The input or output file INITJCL is not allocated. It cannot be opened for I/O.
EXECIO error while trying to GET or PUT a record.
A command entered or contained in a CLIST has invalid syntax.

Kindly please advice.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Sat Mar 05, 2011 4:15 pm
Reply with quote

You would save yourself a lot of time and bother if you read up all about ISPF file tailoring services. Oh so much easier than queueing JCL here there and everywhere.
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Sat Mar 05, 2011 9:31 pm
Reply with quote

saranya, I'm going to re-post your code as how I believe you meant to code it, just the REXX part of it without all the extra TSO crap that's not relevant. Then see if that works for you.

Code:

/*REXX*/ 
QUEUE "//SYSJRST1 JOB (P-1334-Z133),'REST1 VOLS', "                 
QUEUE "//         CLASS=A,TYPRUN=HOLD,"                 
QUEUE "//         MSGCLASS=X,"                 
QUEUE "//         TIME=(,),"                 
QUEUE "//         NOTIFY=&SYSUID"                 
QUEUE "//*"                                                   
"EXECIO * DISKR INPUT (FINIS STEM GP."                                         
DO I = 1 TO GP.0                                                 
  STEPNA = WORD(GP.I,1)                                             
  SPUCB = WORD(GP.I,2)                                               
  SPVOL = WORD(GP.I,3)                                               
  TGVOL = WORD(GP.I,4)                                               
  QUEUE "//"STEPNA" EXEC PGM=ICKDSF,PARM='NOREPLYU',REGION=6M"       
  QUEUE "//SYSPRINT DD SYSOUT=*"             
  QUEUE "//SYSIN  DD   *"               
  QUEUE "INIT UNIT("SPUCB") VFY("SPVOL") INDEX(0,1,30) VTOC(2,1,90)"   
  QUEUE "VOLUME("TGVOL")"   
  QUEUE "/*"   
END                                                                   
"EXECIO "QUEUED()" DISKW INITJCL (FINIS"                                     
EXIT


From what I can tell, you have two DD statements that need to be allocated: INPUT which you read, and INITJCL which you write.
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 purge jobs with return code 0 and ret... JCL & VSAM 4
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 TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
Search our Forums:

Back to Top