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

ISPF skeleton that has IF/THEN/DO statement


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

New User


Joined: 28 Jun 2010
Posts: 14
Location: Australia

PostPosted: Mon Apr 27, 2020 12:52 pm
Reply with quote

Hi!

I'm trying to work out a ISPF skeleton that have this JCL step

//S1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE '&HLQ..FILE1'
IF LASTCC > 0 THEN DO
SET MAXCC=0
END
/*

When I run my rexx to FTINCL above skeleton, I received this error

ISPF112 Substitution error -/-Invalid cond. sub. string, MYSKEL record-118

I've identified the "IF LASTCC > 0 THEN DO" statement that caused this.

but ISPF skeleton control statement is )IF )THEN etc.
why that IF/THEN/DO doesn't work ?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Mon Apr 27, 2020 1:41 pm
Reply with quote

You may try ISPFTTRC to nail down your issue.

https://www.ibm.com/support/knowledgecenter/SSLTBW_2.3.0/com.ibm.zos.v2r3.f54dg00/ispfttrc.htm#ispfttrc
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Mon Apr 27, 2020 1:48 pm
Reply with quote

The > is a skeleton special character. Doubble it like so: IF LASTCC >> 0
Skeleton services special characters are )&?!<|>
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Mon Apr 27, 2020 1:52 pm
Reply with quote

Or use the )DEAULT statement to reasign the special characters.
Back to top
View user's profile Send private message
ecsk

New User


Joined: 28 Jun 2010
Posts: 14
Location: Australia

PostPosted: Mon Apr 27, 2020 2:54 pm
Reply with quote

Willy Jensen wrote:
The > is a skeleton special character. Doubble it like so: IF LASTCC >> 0
Skeleton services special characters are )&?!<|>


Thanks ! works perfectly
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Apr 27, 2020 2:56 pm
Reply with quote

Why bother wlth the test
Code:
IF LASTCC > 0 THEN DO
SET MAXCC=0
END
at all ?
If the RC = 0 it stays zero, else you're setting it to zero.

I'd just set to zero, regardless.

Garry
Back to top
View user's profile Send private message
ecsk

New User


Joined: 28 Jun 2010
Posts: 14
Location: Australia

PostPosted: Mon Apr 27, 2020 3:01 pm
Reply with quote

@Garry

Idea of my step is to delete a file and set cc=0 regardless if the file exists or not.

Hence the check lastcc is done.



[/img]
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Apr 27, 2020 3:07 pm
Reply with quote

ecsk wrote:
@Garry

Idea of my step is to delete a file and set cc=0 regardless if the file exists or not.

Hence the check lastcc is done.



[/img]


I do this all the time to delete/define datasets - but I don't bother checking the return code...

Code:
 DELETE file-name     
                                 
SET MAXCC=0                       
                                 
DEFINE......                 


Works every time - whether the dataset exists or not.

Garry
Back to top
View user's profile Send private message
ecsk

New User


Joined: 28 Jun 2010
Posts: 14
Location: Australia

PostPosted: Mon Apr 27, 2020 3:19 pm
Reply with quote

ah,,, got it. Thanks
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Mon Apr 27, 2020 4:48 pm
Reply with quote

In this particular case - I would suggest just to replace this senseless group of three lines:
Code:
IF LASTCC > 0 THEN DO
SET MAXCC=0
END

With only one line:
Code:
SET MAXCC=0

As one can verify the result of those two "algorithms" is always the same...
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Mon Apr 27, 2020 5:04 pm
Reply with quote

A note regarding the terminology. The topic title
Quote:
ISPF skeleton that has IF/THEN/DO statement
seems to be misleading. Any statement of an ISPF skeleton is some command starting with ')' character. Everything else is just a text to be included into the produced output, including those IF-THEN-END words.

If this output later becomes an input to IDCAMS utility, those IF-THEN-END would become control statements for IDCAMS. In any other case they would remain just a text, or sequence of characters, nothing else...
Back to top
View user's profile Send private message
ecsk

New User


Joined: 28 Jun 2010
Posts: 14
Location: Australia

PostPosted: Tue Apr 28, 2020 3:11 am
Reply with quote

@sergeyken, thanks for the comment. Initially I thought the problem is the IF THEN DO, didn't realise it was the > character, hence I placed it in topic title. I'm not ISPF skeleton guru icon_smile.gif always learn something new if you ask icon_idea.gif
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Tue Apr 28, 2020 4:38 pm
Reply with quote

ecsk wrote:
@sergeyken, thanks for the comment. Initially I thought the problem is the IF THEN DO, didn't realise it was the > character, hence I placed it in topic title. I'm not ISPF skeleton guru icon_smile.gif always learn something new if you ask icon_idea.gif

The main issue is: to understand that in ISPF skeletons everything except FTS commands (those starting with ')' ) is considered as a simple text with no meaning, whether it contains "command words" (like IF-THEN-ELSE, CALL, EXEC, whatever else), or none of them.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue Apr 28, 2020 10:29 pm
Reply with quote

Not quite, special text handling like tabbing is controlled by special characters, hence the OPs problem.
Skeleton services will look for control characters ), &, ?, !, <, |, and >.
FYI you can nullify them all by a statement like this:
)DEFAULT #######
to avoid having to choose 7 new characters.
Resume by a statement like
#DEFAULT )&?!<|>
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Wed Apr 29, 2020 12:47 am
Reply with quote

Willy Jensen wrote:
Not quite, special text handling like tabbing is controlled by special characters, hence the OPs problem.
Skeleton services will look for control characters ), &, ?, !, <, |, and >.
FYI you can nullify them all by a statement like this:
)DEFAULT #######
to avoid having to choose 7 new characters.
Resume by a statement like
#DEFAULT )&?!<|>

The point is: none of IF-THEN-ELSE has any afeection on the result
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Wed Apr 29, 2020 8:39 am
Reply with quote

@ecsk, it seems that you are learning about ISPF skeletons. You should heed Joerg's advice about using the ISPFTTRC command.

1. issue ISPFTTRC command from the ISPF command line to start the trace.
2. Run your program that uses file tailoring
3. issue ISPFTTRC command again to view the trace.
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
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Is there a way to close VSAM files us... CICS 8
No new posts step by step trace 4 ISPF dialog call... TSO/ISPF 17
Search our Forums:

Back to Top