View previous topic :: View next topic
|
Author |
Message |
ecsk
New User
Joined: 28 Jun 2010 Posts: 14 Location: Australia
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1335 Location: Bamberg, Germany
|
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
The > is a skeleton special character. Doubble it like so: IF LASTCC >> 0
Skeleton services special characters are )&?!<|> |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
Or use the )DEAULT statement to reasign the special characters. |
|
Back to top |
|
|
ecsk
New User
Joined: 28 Jun 2010 Posts: 14 Location: Australia
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
ecsk
New User
Joined: 28 Jun 2010 Posts: 14 Location: Australia
|
|
|
|
@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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
ecsk
New User
Joined: 28 Jun 2010 Posts: 14 Location: Australia
|
|
|
|
ah,,, got it. Thanks |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
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:
As one can verify the result of those two "algorithms" is always the same... |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
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 |
|
|
ecsk
New User
Joined: 28 Jun 2010 Posts: 14 Location: Australia
|
|
|
|
@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 always learn something new if you ask |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
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 always learn something new if you ask |
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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
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 |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
@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 |
|
|
|