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
 

 

complex skeleton variables in do loop?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: complex skeleton variables in do loop?
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: 8593
Location: Back in jolly old England

PostPosted: Thu May 08, 2008 11:42 am    Post subject:
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    Post subject:
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: 1703
Location: Australia

PostPosted: Thu May 08, 2008 12:51 pm    Post subject:
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    Post subject:
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    Post subject: not quite there...
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: 8593
Location: Back in jolly old England

PostPosted: Thu May 08, 2008 1:53 pm    Post subject:
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    Post subject: Nah... still no joy!
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: 8593
Location: Back in jolly old England

PostPosted: Thu May 08, 2008 2:14 pm    Post subject:
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    Post subject: That was it!
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: 8593
Location: Back in jolly old England

PostPosted: Thu May 08, 2008 6:23 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Fri May 09, 2008 7:55 am    Post subject:
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    Post subject: Another way....
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: 8593
Location: Back in jolly old England

PostPosted: Fri May 09, 2008 11:59 am    Post subject:
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: 1703
Location: Australia

PostPosted: Fri May 09, 2008 12:09 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts save SAY var loop. italo_pm CLIST & REXX 3 Sun Sep 04, 2016 3:06 am
No new posts Is it possible to pass variables of s... Csongor CLIST & REXX 2 Fri Jun 10, 2016 7:33 pm
No new posts TWS 'global' or 'local' variables Steve Coalbran IBM Tools 2 Thu Mar 17, 2016 7:40 pm
This topic is locked: you cannot edit posts or make replies. ISPF skeleton explanation Akshay Yadav TSO/ISPF 2 Tue Feb 16, 2016 12:47 pm


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