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

complex skeleton variables in do loop?


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Heath Robertson

New User


Joined: 07 May 2008
Posts: 7
Location: Perth, WA

PostPosted: Thu May 08, 2008 9:51 am
Reply with quote

Hi,

I have a batch TSO job creating a multi step job using a skeleton with a do loop. I am trying to use a concatenated variable in skeleton to set various jcl parameters.

The REXX/clist builds variables ;

disk1 = sysars1
volume1 = 200323
disk2 = sysars1
volume2 = 200323

etc...

up to disk20

Then the skeleton has the job card and then a do stmt to to parse through each disk var is sequence. the SKL reads;

//*
)SET Q = 0
)DO 20
)SET Q = &Q + 1
)SET TD = "DISK&Q"
)cm builds TD as DISK1 on initial run
)SET TDISK "&"&TD
)cm here I wanted to build a string &disk1, but fails with RC=20 as shown )cm in the ISPFTTRC output.
)IF &TDISK = NO THEN )LEAVE
//*
//* RESTORE OF VOLUME &DISK.&Q STEP&Q
//*
//RSTVOL&Q EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//TAPEIN DD DSN=&DSN.&Q,
// DISP=OLD,
// UNIT=3590-1,VOL=(,RETAIN,,SER=&VOLS.&Q),
// LABEL=&LABEL&.Q
//DISKOUT DD DISP=OLD,UNIT=3390,VOL=SER=&DISK.&Q
//SYSIN DD *
RESTORE FULL INDD(TAPEIN) OUTDD(DISKOUT)
)ENDDO

I want to build a variable that refers to the constant string "&DISK" and the counter "Q". so that when I test "&TDISK above it resolves to the value of the variable value &DISK1 built in the REXX.

If I change the )SET TD = "DISK&Q" to read )SET TD = "&DISK&Q" then the ISPFTTRC output shows that this resolves to "SYSARS11" and not "&DISK1"

Has anyone achieved this or managed this in some other way?


Any help appreciated,
Heath
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu May 08, 2008 11:42 am
Reply with quote

Would it not be easier to invoke the skeleton FTINCL from the REXX each time a new volume is encountered.

That way you keep the DO loop in the REXX where it is easier to code and control.
Back to top
View user's profile Send private message
Heath Robertson

New User


Joined: 07 May 2008
Posts: 7
Location: Perth, WA

PostPosted: Thu May 08, 2008 12:41 pm
Reply with quote

expat wrote:
Would it not be easier to invoke the skeleton FTINCL from the REXX each time a new volume is encountered.

That way you keep the DO loop in the REXX where it is easier to code and control.


I did Try this.... But only the first Include member was in the output each time, with the no replace option. Otherwise it was only the last FTINCL that was there...

But if you have an example of this that works I'd be happy to try it!
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu May 08, 2008 12:51 pm
Reply with quote

Hi,
you may need to show some of the code.

Are you using FTCLOSE after each FTINCL ?


Gerry
Back to top
View user's profile Send private message
Heath Robertson

New User


Joined: 07 May 2008
Posts: 7
Location: Perth, WA

PostPosted: Thu May 08, 2008 1:03 pm
Reply with quote

so are you saying that for each step include I should

FTOPEN,

FTINCL,

FTLOSE

With a Alloc and free outside my loop?

I'll give that a try!
Back to top
View user's profile Send private message
Heath Robertson

New User


Joined: 07 May 2008
Posts: 7
Location: Perth, WA

PostPosted: Thu May 08, 2008 1:46 pm
Reply with quote

icon_sad.gif

Ok... I tried this two ways.... Did the Open, and included the Jobcard skel.

Then following that did a close, e.g.

"ALLOC F(ISPFILE) DA('dataset(member)') shr"
"ispfttrc skl(*)"
"ISPEXEC FTOPEN"
"ISPEXEC FTINCL dfdssklj"
"ispexec ftclose name(dfdssrst)"

This includes the Jobcard..

Then I updated the section for each step as follows;

"ISPEXEC FTOPEN"
"ISPEXEC FTINCL dfdsskls"
"ispexec ftclose name(dfdssrst)"

This section includes the step for each unit etc.

When looking in the output file the tayloring is there, but ony the last FTINCL.... I removed the second Open and the result was the same.....

Ideas?
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu May 08, 2008 1:53 pm
Reply with quote

Try something like this
Code:

"ISPEXEC FTOPEN"         
"ISPEXEC FTINCL TEST01"  /*JOBCARD*/
DO A = 1 TO 10           
  STP = RIGHT(A,4,'0')   
  "ISPEXEC FTINCL TEST02" /*EXEC CARD */
END                     
"ISPEXEC FTCLOSE"       
Back to top
View user's profile Send private message
Heath Robertson

New User


Joined: 07 May 2008
Posts: 7
Location: Perth, WA

PostPosted: Thu May 08, 2008 2:05 pm
Reply with quote

expat,

Did you try that and did it work?

I updated my rexx in a similar fashion, and NO JOY...

REXX loop was;

"ALLOC F(ISPFILE) DA('hyr.RECOVERY.JOBS(dfdssrst)') shr"
"ispfttrc skl(*)"
"ISPEXEC FTOPEN"
"ISPEXEC FTINCL dfdssklj"
do out = 1 to dsname.0
dsname = dsname.out
label = label.out
vols = vols.out
disk = disk.out
"ISPEXEC FTINCL dfdsskls"
end
"ispexec ftclose name(dfdssrst)"

and still only the last ftincl...

This is driving me crazy!
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu May 08, 2008 2:14 pm
Reply with quote

I allocate my ISPFILE as a PS dataset

TEST02 skeleton
Code:

//*                       
//*   STEP NUMBER &STP     
//*                       
//STEP&STP EXEC PGM=IEFBR14


Using the REXX posted above, ISPFILE contains
Code:

//*                       
//*   STEP NUMBER 0001     
//*                       
//STEP0001 EXEC PGM=IEFBR14
//*                       
//*   STEP NUMBER 0002     
//*                       
//STEP0002 EXEC PGM=IEFBR14
//*                       
//*   STEP NUMBER 0003     
//*                       
//STEP0003 EXEC PGM=IEFBR14
//*                       
//*   STEP NUMBER 0004     
............ through to 10
Back to top
View user's profile Send private message
Heath Robertson

New User


Joined: 07 May 2008
Posts: 7
Location: Perth, WA

PostPosted: Thu May 08, 2008 5:29 pm
Reply with quote

Thanks for that Expat!

I was allocation a PDS member as the ISPFILE dd using an ispalloc.

I then altered the job to use a ddstmt of ISPFILE and a sequential file and it worked.

Thanks for your input.

HEATH
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu May 08, 2008 6:23 pm
Reply with quote

I can somewhere recall having a similar problem years ago and recalled using a PS ISPFILE and the problem was fixed. Since then I use only PS where possible.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri May 09, 2008 7:55 am
Reply with quote

Hi Heath,
I tried the following code and writing to a PDS without any problems.

I can never remember writing an ISPFILE to a PS file.

Code:
/*REXX*****************************************************************/
"ALLOC F(ISPFILE) DA('CSCSGLC.DMS.CNTL') shr"                           
"ispfttrc skl(*)"                                                       
"ISPEXEC FTOPEN"                                                       
  "ISPEXEC FTINCL GLC1" /*JOB  CARD */                                 
DO A = 1 TO 10                                                         
  "ISPEXEC FTINCL GLC2" /*EXEC CARD */                                 
END                                                                     
"ispexec ftclose name(b)"                                               
"ISPEXEC FTCLOSE"                                                       


Output
Code:
EDIT       CSCSGLC.DMS.CNTL(B) - 01.00                     Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 ??JOBCARD                                                               
000002 ??VOLUME                                                               
000003 ??VOLUME                                                               
000004 ??VOLUME                                                               
000005 ??VOLUME                                                               
000006 ??VOLUME                                                               
000007 ??VOLUME                                                               
000008 ??VOLUME                                                               
000009 ??VOLUME                                                               
000010 ??VOLUME                                                               
000011 ??VOLUME                                                               


Gerry
Back to top
View user's profile Send private message
Heath Robertson

New User


Joined: 07 May 2008
Posts: 7
Location: Perth, WA

PostPosted: Fri May 09, 2008 8:04 am
Reply with quote

Gerry,

In your example you allocated the PDS without member name in the Alloc statement. and then only specified the member name in the ispexec ftclose statement.

So this may have been my error all along. Because the change I am putting in means I generate one multi step job rather than 14 single step one, I am allocating the DD within the JCL.

But using the name option may have really been the option all along!

Thanks...
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri May 09, 2008 11:59 am
Reply with quote

Quote:
I can never remember writing an ISPFILE to a PS file.

At my age I'm happy if I remember my password at first attempt icon_biggrin.gif
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri May 09, 2008 12:09 pm
Reply with quote

Hi Expat,

you too must have been born at an early age.

Gerry
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts JCL with variables JCL & VSAM 1
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts JCL Variables JCL & VSAM 1
No new posts reset/clear ALL application profile v... TSO/ISPF 3
Search our Forums:

Back to Top