Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
ISPF skeleton that has IF/THEN/DO statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
ecsk

New User


Joined: 28 Jun 2010
Posts: 8
Location: Australia

PostPosted: Mon Apr 27, 2020 12:52 pm    Post subject: ISPF skeleton that has IF/THEN/DO statement
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

Active User


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

PostPosted: Mon Apr 27, 2020 1:41 pm    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 373
Location: Denmark

PostPosted: Mon Apr 27, 2020 1:48 pm    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 373
Location: Denmark

PostPosted: Mon Apr 27, 2020 1:52 pm    Post subject:
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: 8
Location: Australia

PostPosted: Mon Apr 27, 2020 2:54 pm    Post subject:
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: 1085
Location: Dublin, Ireland

PostPosted: Mon Apr 27, 2020 2:56 pm    Post subject:
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: 8
Location: Australia

PostPosted: Mon Apr 27, 2020 3:01 pm    Post subject:
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: 1085
Location: Dublin, Ireland

PostPosted: Mon Apr 27, 2020 3:07 pm    Post subject:
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: 8
Location: Australia

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

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

Active Member


Joined: 29 Apr 2008
Posts: 811
Location: Maryland

PostPosted: Mon Apr 27, 2020 4:48 pm    Post subject:
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

Active Member


Joined: 29 Apr 2008
Posts: 811
Location: Maryland

PostPosted: Mon Apr 27, 2020 5:04 pm    Post subject:
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: 8
Location: Australia

PostPosted: Tue Apr 28, 2020 3:11 am    Post subject:
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

Active Member


Joined: 29 Apr 2008
Posts: 811
Location: Maryland

PostPosted: Tue Apr 28, 2020 4:38 pm    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 373
Location: Denmark

PostPosted: Tue Apr 28, 2020 10:29 pm    Post subject:
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

Active Member


Joined: 29 Apr 2008
Posts: 811
Location: Maryland

PostPosted: Wed Apr 29, 2020 12:47 am    Post subject:
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

Senior Member


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

PostPosted: Wed Apr 29, 2020 8:39 am    Post subject: Reply to: ISPF skeleton that has IF/THEN/DO statement
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    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 Required Date Format in Include Sort ... vivky_vivek DFSORT/ICETOOL 2 Fri Aug 14, 2020 6:52 am
No new posts ISPF Panel commands DDLIST /LISTBOX Wesley TSO/ISPF 11 Thu Aug 06, 2020 11:25 pm
No new posts Am Getting a vertical line in ISPF SC... Himansu22 TSO/ISPF 3 Fri Jul 31, 2020 11:58 pm
No new posts CALL statement in COBOL for VSE Kirthishine COBOL Programming 3 Fri Jun 26, 2020 12:12 pm
No new posts ISPF Edit Macro with profile commands... Lynne Schuler TSO/ISPF 14 Thu Jun 18, 2020 7:25 pm

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