Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Rexx code for ICKDSF INIT JOB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Rexx code for ICKDSF INIT JOB
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: 1703
Location: Australia

PostPosted: Sat Mar 05, 2011 2:29 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Sat Mar 05, 2011 4:15 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Sat Mar 05, 2011 9:31 pm    Post subject: Reply to: Rexx code for ICKDSF INIT JOB
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm
No new posts How to Run Rexx Macro? Kalaivignesh CLIST & REXX 5 Fri Sep 01, 2017 9:08 pm
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us