Skeleton Example



IBM's Command List programming language & Restructured Extended Executor

Skeleton Example

Postby RazVorox » Thu Jun 01, 2023 5:44 pm

Could someone please refer me to a BASIC, SIMPLE, end-to-end example
of file tailoring?

I would like to see, end-to-end, working, code,
where a basic REXX, modifies and submits, a basic JCL skeleton.

I've been through the forum, I've been through the network,
I've been through the IBM ASM example manuals etc.
I've even found some online examples.
I just cant seem to make it work.

I'm not necessarily looking for a fix to my code.
any other basic example would also work.
Just the most basic "HelloWorld" working skeleton example.

I assume I'm failing the actual tailoring bit,
but at this point.. I'm just tired.

first - a jcl calling a basix rexx.
MY.DSN.PROJ.NAME(MAINJCL)

//RZVRX00  ..and the rest of the jobcard..
//*=======|============================================================
//* Run REXX
//*=======|============================================================
//RUNPRG   EXEC PGM=IKJEFT01,REGION=0M
//SYSEXEC  DD DSN=MY.DSN.PROJ.NAME,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN  DD *
  %SKLTRX01
/*
 


so far - so good.
now the rexx, that changes the skeleton
MY.DSN.PROJ.NAME(SKLTRX01)


/* REXX */
say "Hello Skeleton! "
/* pass params.. */
  USR = "RazVrx"
  NUM = 36                                
  PARAM = "tester52"

/* tailor jcl */
/* SKLT001 is the DS member name . */
  "ISPEXEC FTOPEN"                                  
  "ISPEXEC FTINCL SKLT001"                        
  "ISPEXEC FTCLOSE"                    

  ADDRESS TSO                                        
  "SUB '"MY.DSN.PROJ.NAME"("SKLT001")'"          

exit 0
 


and finaly, the skeleton -
MY.DSN.PROJ.NAME(SKLT001)


//&USR.01  ..the rest of the jobcard..
//  NOTIFY=&USR
//*=======|============================================================
//* HELLO WORLD JCL SKELETON
//*=======|============================================================
//STEP0001 EXEC PGM=IEBGENER
//SYSIN    DD  DUMMY
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  *
HELLO, &PARAM, number &NUM
/*
//SYSUT2    DD  SYSOUT=*
//*=======|========================[]==================================
 


I don't think i can get it more simple than that.
Something just.. doesn't work.
RazVorox
 
Posts: 16
Joined: Wed Oct 19, 2022 11:52 am
Has thanked: 7 times
Been thanked: 1 time

Re: Skeleton Example

Postby sergeyken » Thu Jun 01, 2023 9:22 pm

RazVorox wrote:Something just.. doesn't work.

Without clear explanation: what does this mean? - you can hardly get an answer... :?

There are only three options:
1) your computer has exploded, and nothing left?
or
2) you've got an error message? What it is?
or
3) you've got some unexpected results? What they are?

Which one is your case?
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 408
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Skeleton Example

Postby sergeyken » Thu Jun 01, 2023 9:45 pm

I'd recommend you to start with reading carefully the available manuals on FTS.
Why do you suppose other people have to do this part of your own job (e.g. getting knowledge on the tool(s) you are supposed to use) instead of yourself?

Did you ever read this - https://www.ibm.com/docs/fr/zos/2.1.0?t ... -tailoring ?

This is definitely what is missing from your example:
The FTOPEN service, which begins the file tailoring process, allows skeleton files to be accessed from the skeleton library specified by ddname ISPSLIB. The skeleton library must be allocated before invoking ISPF. ISPSLIB can specify a concatenation of files.

If output from file tailoring is not to be placed in a temporary file, the desired output file must be allocated to the ddname ISPFILE before invoking this service. ISPFILE can designate either a library or a sequential file. The skeleton files can contain variable-length records, with a maximum record length of 255.


And this can be discovered after the first glimpse at your "samples"! :twisted:
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 408
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Skeleton Example

Postby Pedro » Thu Jun 01, 2023 11:19 pm

now the rexx, that changes the skeleton


fyi. The skeleton does not get changed. The skeleton is static.

What happens is that there are two inputs:
1. skeleton file
2. variables set from rexx

And one output:
1. ISPFILE

The inputs are merged during FTINCL and saved to the file allocated to ISPFILE, which means that you are submitting the wrong file.

I retired several years ago, so my recollection is hazy, but my suggestion is to create a dataset dedicated for this purpose and allocate it to ISPFILE before you start the file tailoring process.

Typically, the default output file is a temporary dataset, the name of which is in variable ZTEMPF.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Skeleton Example

Postby enrico-sorichetti » Fri Jun 02, 2023 3:44 am

see here

https://ibmmainframes.com/viewtopic.php ... ght=ftincl

the thing is made of an edit macro which accepts 2 args ... number od jobs, number of steps
and two skels the jobcard skel and the step skel

nothing useful, just generate some torture jobs with different number of steps to take some timings for submit and jcl conversion
and demonstrate that somentimes the sequence of execution is not the sequence in which the jobs were submitted
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

These users thanked the author enrico-sorichetti for the post:
RazVorox (Wed Jun 07, 2023 11:38 am)
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Skeleton Example

Postby RazVorox » Sun Jun 04, 2023 12:17 pm

Thank you all for the links, patience, and explanation.

The reason I don't do part of the research myself,
is simply because I don't really know what, or how,
or in what order to look for the "missing" pieces.

I am stuck in one of those impossible situations,
in which i have to learn on the go, and deliver, at the same time.
from scratch.

Your assistance is highly appreciated.

I learn through code, comparing it to prior knowledge of how things work in other systems/languages,
and i do my best to go over manuals on my "free" time (weekends etc).

That is NOT an excuse, but an explanation.

ATM, I realize that i lack the basic understanding of the interaction of different parts
of the actual MF, so pointing me to a working example, with the correct manual, goes a long way.

I'm piecing the different puzzle bits and pieces as I go along.

I'll adapt and make the code work - Thanks enrico.
I'll take notes of the ISPFILE, and will read in depth about it - Thanks pedro.

Sergey - I was literally thrown into shark infested water, with bleeding cuts, without knowing how to swim.
well, not literally. figuratively, but you get the jist.
I don't mean for other to study in my place. I just really, really, have no idea.
So I appreciate the patience, and the link.
I've obviously either didn't read it through, or understood it's importance.
So.. I'll take it as the new starting point.

Have a great week guys.
Thanks, a lot.
RazVorox
 
Posts: 16
Joined: Wed Oct 19, 2022 11:52 am
Has thanked: 7 times
Been thanked: 1 time

Re: Skeleton Example

Postby enrico-sorichetti » Sun Jun 04, 2023 2:32 pm

I'll adapt and make the code work - Thanks enrico.


if You want a much more sophisticated example see the masschg application/dialog here

https://ibmmainframes.com/viewtopic.php ... ht=masschg

you will see also the use of rexx inside a panel

fixed ... the should work now
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

These users thanked the author enrico-sorichetti for the post:
RazVorox (Wed Jun 07, 2023 11:39 am)
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Skeleton Example

Postby dneufarth » Sun Jun 04, 2023 5:45 pm

correction needed for Enrico's link above (https://ibmmainframes.com/viewtopic.php ... ht=masschg)
dneufarth
 
Posts: 23
Joined: Thu Oct 15, 2009 2:50 am
Has thanked: 1 time
Been thanked: 2 times

Re: Skeleton Example

Postby willy jensen » Mon Jun 05, 2023 2:02 am

Ok lets take it from the top. Your generator job must be set up to run ISPF. You could of course use dynamic allocations, but JCL makes it clearer. You can then add the ISPFILE DD directly in the JCL. Contact you sysprog staff for dataset names, or just look at the datasets allocated to your current TSO/ISPF online session. Note the ISPSTART command at the end, it is what starts ISPF and runs your REXX pgm. You can change SYSOUT=(A,INTRDR) to SYSOUT=A while testing so you can eye-ball the result.
//ISPBATR  EXEC PGM=IKJEFT1B                                  
//SYSEXEC  DD DISP=SHR,DSN=my.exec.lib                        
//SYSTSPRT DD SYSOUT=*                                        
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU     <-- verify        
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU     <-- verify        
//ISPSLIB  DD DISP=SHR,DSN=my.skel.lib                        
//ISPTLIB  DD DISP=SHR,DSN=ISP.SISPTENU     <-- verify        
//ISPPROF  DD UNIT=SYSDA,SPACE=(TRK,(1,1,1)),                
//            DCB=(ISP.SISPMENU)            <-- verify        
//ISPLOG   DD SYSOUT=*,RECFM=VA,LRECL=125,BLKSIZE=129        
//ISPLST1  DD SYSOUT=*                                        
//ISPFILE  DD SYSOUT=(A,INTRDR),RECFM=FB,LRECL=80,BLKSIZE=6240
//SYSTSIN  DD *                                              
 Ispstart cmd(%SKLTRX01)

Now to the driver REXX. You use the USR variable to generate a jobname, so it must be in uppercase. You need to add the 'ADDRESS ISPEXEC' statement either once before the first ISPF command, or in front of each ISPF command. As the ISPFILE DD is in the JCL, you dont need to allocate it in the REXX pgm.
/* REXX */                                      
  say "Hello Skeleton! "                        
  /* pass params.. */                            
  USR = "RAZVRX"          /* must be uppercase */
  NUM = 36                                      
  PARAM = "tester52"                            
                                                 
  /* tailor jcl */                              
  Address ispexec                                /* ****Note*** */
  /* SKLT001 is the DS member name . */          
  "ISPEXEC FTOPEN"                              
  "ISPEXEC FTINCL SKLT001"                      
  "ISPEXEC FTCLOSE"                              
  exit 0                                        

Finally your skeleton, should be ok after you add valid parameters, i.e.
//&USR.01 JOB,'skeleton-test',CLASS=A,MSGLEVEL=(1,1),  
//       MSGCLASS=X,TIME=NOLIMIT,REGION=64M,COND=(0,LT)
//*                                                    
//* HELLO WORLD JCL SKELETON                            
//*                                                    
//STEP0001 EXEC PGM=IEBGENER                            
//SYSIN    DD  DUMMY                                    
//SYSPRINT DD  SYSOUT=*                                
//SYSUT1   DD  *                                        
HELLO, &PARAM, number &NUM                              
/*                                                      
//SYSUT2    DD  SYSOUT=*                                

These users thanked the author willy jensen for the post:
RazVorox (Wed Jun 07, 2023 11:39 am)
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post