Sunday, June 10, 2007

JCL

TIP # 023
JCL

Hero's Method:
If you prefer a dataset to be not deleted accidentally, then
---------------------------------------------------------------------------------------------------------------------
USING IDCAMS USING JCL COMMENTS
---------------------------------------------------------------------------------------------------------------------
TO(04365) LABEL=RETPD=04365 Will protect till end of 2004
FOR(30) LABEL=RETPD=10 Will protect for 30 days
---------------------------------------------------------------------------------------------------------------------
Villain's Method:
If by chance of fate, you want to delete a dataset that is protected by the above method...
Use IDCAMS DELETE command with PURGE option.
e.g.,
//STEP1 EXEC PGM=EXEC
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE TOP.SECRET.DATA -
PURGE
/*

TIP # 024
JCL

Is it possible to execute a program from any library using the referback?
The Answer is Yes!
//STEP1 EXEC PGM=IEFBR14
//PROGRAM DD DSN=SYSTEM.PGM.LOADLIB(COBOLPGM),DISP=SHR
//STEP2 EXEC PGM=*.STEP1.PROGRAM

TIP # 025
JCL

How does the system differentiates between JCL comment statements (i.e., //* statements) and
JES3 Statements (which also start with //* ) ?
If the 4th column contains JES3 keyword, the line is considered to be JES3 statement, else it is
considered as normal JCL statement.

TIP # 026
JCL

We know JES2 and JES3 , but is there any JES1?
OS/VS1 (the forefather of MVS) supported only one job entry subsystem namely JES1

TIP # 027
JCL

Consider this situation.
I have a JCL with 10 steps.
For reasons known only to me, I want to execute step 5 only.
How can I do it?

One way to do it is to use RESTART from STEP05, but it will try to execute the
subsequent steps too.
We have to insert null statement after step05 to prevent the execution of
subsequent steps.
But one decent way is there in which we don’t need to touch the job steps
code, but alter only the Jobcard.
And that is....
In the JOBCARD, code COND parameter. Then, when the Job is executed , only
the Step mentioned in the RESTART parameter will get executed.
e.g., RESTART=STEP05,COND=(0,LE)

TIP # 028
JCL

We know that JOBLIB statement must be placed after the JOB statement and before the first
EXEC statement in the job.
But, the STEPLIB statement can be placed anywhere in the particular step’s JCL (not necessarily
the first DD statement in the STEP).

TIP # 029
JCL

Here is a quick question. Can Catalog Procedure have PEND
statement?
Yes! Now it can have PEND Statement.
Do check it out….

TIP # 030
JCL

How much data can TAPE store??
A typical tape reel might contain 170 MB whereas tape cartridges can contain as much as
10GB.
(Source: System 390 JCL by Gary DeWard Brown)

TIP # 031
JCL

Do you know why null statement was introduced in JCL?
Back when punched cards were used, a null coded on distinctive colored cards was used to help
operators separate card decks. ( Hence , it helped to identify the end-of-job card, and the start of
next job for the operators)
(Source: System 390 JCL by Gary DeWard Brown)

TIP # 032
JCL

Do you know why JCL has ‘//’ in col 1& 2 in each Statement??
The Slashes date back from when PUNCHED CARDS were used to submit JCL code for
execution. If the cards were mistakenly put back to front in the reader, the slashes wouldn’t be
read first and so the card deck could be rejected. So ‘//’ ensures that the punched cards are placed
properly!!
(Source: System 390 JCL by Gary DeWard Brown)

TIP # 033
JCL

How can I specify dummy VSAM dataset in a JCL?
Code AMP=’AMORG’ . This parameter tells the OS to treat the file as VSAM file.
//NOVSAMIO DD DUMMY,AMP=’AMORG’

TIP # 034
JCL

I can specify the max limit of TIME parameter as
TIME=NOLIMIT or
TIME=MAXIMUM.

Now which specification gives maximum time for a JOB?
TIME=MAXIMUM will allow the job to run for 357912 minutes (248.55 days)
TIME=NOLIMIT will allow the job for unlimited amount of time
Another advantage of NOLIMIT option is that it can remain in wait status for more than the installation
time limit.

TIP # 035
JCL

I want to delete a member in a PDS, but someone is using it. How can I delete it?
One can use the following JCL
//DELMEMB EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//PDS DD DSN=libraryname,DISP=SHR
//SYSIN DD *
ALLOC DDN(INFILE) SHR REUSE DSN('libraryname')
DELETE libraryname(membername) FILE(PDS)

TIP # 036
JCL

&SYSUID is a "system symbol" for which the system substitutes your TSO ID.
It is the only system symbol that can be used in a batch job, and can be useful when more than one
individual submits the same JCL.

TIP # 037
JCL

I am overriding 2 DD statements in a PROC from my JCL. The first DD statement is in step 10 and
second DD statement is in step 40.
Usually , I specify as
//PS010.INPUT DD DSN=MYID.DATASET
//PS040.SYSIN DD DSN= MYID.NEW.DATASET
What will happen if I specify step 40 first and step 10 next?
zOS JCL will process it! It will override irrespective of the order it is specified. Formerly out-of-order DD
overrides were ignored.

ISPF

TIP # 001
ISPF

Lets start with a generic and simpler one.
Consider that you are editing a file/program and you want to know the changes you have done
since the last SAVE command.
How to find that?

Answer:
Give COMPARE SESSION on the command line
Further use of COMPARE commands...
- Can be used like 3.13 option

TIP # 002
ISPF

Usually the PDS or PS bears the ID of the creator or the ID of the person who modified it
recently.But is it possible to change these ID values without leaving trace of one’s own ID?

Answer:
Yes its possible! In the command area against the member name or PS name, by giving ‘G’.
Dialog box will pop up allowing you to change the ID values.

TIP # 003
ISPF

Suppose you are in a ISPF Screen and want to know in which TSO Region ( Development,
Production, or other TSO regions) you are now .
Answer:
Issue on the command line : SAREA
ISPF STATISTICS Pop-up window will show you the region( and other info too)


TIP # 004
ISPF

Any command entered in the COMMAND LINE disappears after the successful execution of its
intended function.
If you want to repeat the same command , you got to re-type it or use some PF key to retrieve the
last command entered.
But here is a cool method the make the command entered not to disappear and stay on the screen.
Precede commands with '&'

For Example:
COMMAND ===> &C '110-PARA' '220-PARA' SCROLL ===> CSR
****** ************************ TOP OF DATA **************
000001 IDENTIFICATION DIVISION.
000002 PROGRAM-ID. COBOLSAMY.
000003 DATE-WRITTEN. APRIL 2004.
After the execution of the command, the below command stays on the screen.
This way you can entering the same command or modifying the command a little and using it
multiple times.

TIP # 005
ISPF

While trying to open any member in a PDS, we sometimes come across
"member in use" message. In that situation, if you want to know who is using the member
currently, press F1 twice.

TIP # 006
ISPF

We usual search for members in a PDS by the first string of the members.
Consider this situation .
I have a PDS and I want to search it for member only by middle string of the members.
e.g. there are some members like BESTJCL1,RESTJCL2,PESTCBL1, BESTCBL2,
WESTCBL3,TESTASM1,BESTASM2...etc
I want to find members which have CBL in them.
How can I search and find these members?

Answer:
Use ISPF 4.12 option.
Specify the dataset to be searched and the pattern of the string.
Specify the LANG type as COB
And select the browse option.

TIP # 007
ISPF

How can I find the last 10 datasets that I have accessed ?
Answer:
1.GO TO ISPF 3.4 option.
2. On the top, there is a MENUBAR. Select REFLIST
3. Select Option 1 in it.
Using this option you can find out the last 30 datasets that you have accessed....

TIP # 008
ISPF

Alternate to SuperCE Option(3.13) is to use the macro COMPARE .
Use this when you there is less difference between the two files.
1
.Open a DSN in EDIT or VIEW Mode
2. On the Command line , issue COMP 'YOUR.SECOND.COMPARISON.DSN'
3. If you want only the changes to be listed, issue COMP
'YOUR.SECOND.COMPARISON.DSN' EXC


TIP # 009
ISPF

While Browsing Internet, we have some cool option called address autocomplete…we enter
some letters in the address bar and the browser auto completes it with the closest guess.
Does MAINFRAME has the same feature??

Answer:
Yes! It has “Autocomplete” feature!!!
How to use it?
1.go to ISPF 3.4 ,
2. enter KEYS in the command line,KEYS window will popup
3. set any key to AUTOTYPE, save and exit
2. now type any Dataset partially and press the assigned PFkey!!
Note: It will not retrieve GDGs and VSAM files.

TIP # 010
ISPF

I want to find a member but I don’t know the PDS to which it belongs. I only know the high
level qualifier of the PDS.
Answer:
For example, lets consider high level Qualifier as MYID.MYAPPLN.* and member as MYMEM
1. Go to 3.4 and list all PDS with MYID.MYAPPLN.*
2. Now issue, MEMBER MYMEM on the command line

TIP # 011
ISPF

I want to know what are the last 25 COMMAND LINE commands that I have issued from ISPF
panel.
Answer:
To get that, I have to issue, RETP on the Command line.


TIP # 012
ISPF

I want to edit a member, which has CBL as middle string in the PDS MY.PDS.MEMBERS.
One shortcut way is to in the ISPF 3.4 listing of the PDS,
issue S *CBL* E in the command line. If we don’t use E at the end, it will open in browse mode.

TIP # 013
ISPF

Here is another tip on ISPF 3.4 Option
Usually to find the last edited member, we issue SORT CHA or SORT CHANGED on
the command line.
One can save few keystrokes by placing the cursor on any of the column
header in the ISPF 3.4, and press ENTER.
In our case, if we place the cursor on the CHANGED header, we will get the
members sorted on that column.

TIP # 014
ISPF

Here is a tip by which you can avoid ISPF 3.4 Option!!!
To Open a PS or PDS member, we usually use ISPF 3.4 to open in EDIT or BROWSE
MODE.
Here is one way where one can open PS or PDS member in EDIT/VIEW/BROWSE
mode from any command line.
Thus, we can avoid using 3.4 option.
Issue : EPDF ‘MYID.MYPS’ . The Dataset will be opened in EDIT MODE
If you want to open in VIEW mode:
Issue : EPDF ‘MYID.MYPS’ VIEW
Similarly, for opening in BROWSE mode, type BROWSE at the end.


TIP # 015
ISPF

Here is a situation. I have received a maintenance change
request on one of the program.
While I am making changes to the program, one of my friend pops
in and I leave with him for a cup of coffee without SAVING the
changes I made.
After few minutes , when I am back, I am not sure what changes I
made previously on the program?
How can I find the changes I have made (without getting out of
this screen)?
Well, here is one simple command line command to achieve this...
Issue : COMP * X

TIP # 016
ISPF

When I issue CUT , I know that the CUT content are placed in a
clipboard. And when I issue PASTE, the clipboard content are
pasted.
But is it possible for me to view/edit the clipboard ?
One can view the clipboard after any valid CUT command was issued.
To view the clipboard, issue : CUT DISPLAY.
Clipboard manager will pop up and gives us options to edit or browse the
content.

TIP # 017
ISPF

Here is another tip on ISPF CUT. I have a dataset with 10,000
lines.I want to cut the first 10 lines and last 10 lines and
paste into another dataset.When I cut the first 10 lines and
then again the last 10 lines ,only the last 10 lines are pasted
into the new dataset.
Is there anyway out (other than doing a 2 cut & paste)?

The answer for the above question is to:
1.first cut 10 lines, then issue CUT APPEND
2.then cut last 10 lines, then issue CUT APPEND
3.When you PASTE it, you got both.

TIP # 017
ISPF

Tired of typing the often-used datasets repeated?!!!
We have seen AUTOTYPE previously. Here is another one that saves lots of key-strokes.
Use NRETRIEV.
How to use it?
1 enter KEYS in the command line,KEYS window will popup
2 set any key to NRETRIEV and exit
3 now when you are in 3.4 or whichever screen you have set the KEYS option, press the
assigned PF keys.
4. Pressing them repeated will bring up one-by-one the last 30 accessed datasets from the reflist.

TIP # 018
ISPF

Here is one simple one.......
I want to search a string like 'abc' (including quote).
In my pgm there may be more abc strings.But i don't want to retrieve all of them.
i need the abc enclosed with quotes.
How to search is in 3.14 option?.
In the ISPF 3.14 , search with ‘’’abc’’’ string.(i.e. with 3 quotes at both sides of the string)

TIP # 019
ISPF

I have to compare one input file field with one output file field. The input file field in is column
1 to 10 and the output file field is in column 40 to 50.
How can I do it?

1. Use the standard 3.13 ISPF option. In the same screen itself, in the command line issue, E
2. then type,
CMPCOLN 40:50
CMPCOLO 1:10
3. press PF3 and exit
4. In the New dataset , type in the output dataset
5. In the Old dataset , type in the input dataset

TIP # 020
ISPF

Is an easy way to search member in Multiple PDS?
Go to 3.4 (where all the datasets will be displayed) .
In the Command line give
Command line==>M memname
This command will not work for the migrated PDS. So ensure all the PDS are in
Disk.
Now the message "MEMBER(S): memname found" will apppear in the right side of
the panel.

TIP # 021
ISPF

I have data which is of length 160. For some reasons, I want to wrap the data in each record to 80
characters and have the next 80 characters in the next line. So basically what I am looking for is ,
“Is there command similar to Wordwrap (as in Notepad or MS WORD) in mainframe?”
Yes, with ISPF, one can wrap the data as required.
To do that,
1.Open the dataset in ISPF EDIT mode.
2.In the first line, issue the line command: TF80 (as in this case I want to wrap to 80 chars per
line)
3.All the subsequent lines will wrap to 80 chars per line.


TIP # 022
ISPF

Here is another tip on ISPF 3.4 option
From the ISPF 3.4 option listing, I can directly Edit/Browse/view the member without listing all
the members and then select the particular member.
To do that,
In the Line command issue, E / (member)
use for Browse (B) and view (V)
Command - Enter "/" to select action Message Volume
-------------------------------------------------------------------------------
E /(MEMBER1)MYID.WORK.SRC NV1E56
***************************** End of Data Set list ****************************