Wednesday 13 March 2013

EDIT Line commands - CREATE


EDIT LINE commands - CREATE

CREATE is used to move or copy data from dataset we are editing to a new dataset.

Suppose we are working with below JCL:

***************************** Top of Data ******************************
//TESTJCL1 JOB (XXXX),'TEST JCL',NOTIFY=&SYSUID                        
//teststep EXEC PGM=TESTPGM1                                           
//STEPLIB DD DSN=CMN.TEST.STGO.#001621.LOD,DISP=SHR                    
//MINPUT  DD DSN=SUKULR.TESTFILE.MASTER2,DISP=(OLD,CATLG,CATLG),       
//SYSIN   DD *                                                         
12  sukul mahadik                                                      
35000 Y 30 DUKINGNT                                                    
JADAV 67000 Y 40                                                       
MAHENDRA GAREWAL                                                       
20000 N                                                                
/*                                                                     
**************************** Bottom of Data ****************************

And we wish to copy the lines 4 to 8 to a new dataset named COPYJCL1.

To perform this we would first copy the lines using the C or CC commands. If we want to move the data from original datasets then we use the M or MM commands.

Then we type 'CREATE membername' or just 'CREATE' on the command line and hit enter.

If we don’t specify the member name then we get a selection panel where we can choose which panel to copy and what should be the name of new member.

Command ===> create copyjcl1                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //TESTJCL1 JOB (XXXX),'TEST JCL',NOTIFY=&SYSUID                        
000002 //teststep EXEC PGM=TESTPGM1                                           
000003 //STEPLIB DD DSN=CMN.TEST.STGO.#001621.LOD,DISP=SHR                    
CC     //MINPUT  DD DSN=SUKULR.TESTFILE.MASTER2,DISP=(OLD,CATLG,CATLG),       
000005 //SYSIN   DD *                                                         
000006 12  sukul mahadik                                                      
000007 35000 Y 30 DUKINGNT                                                    
CC     JADAV 67000 Y 40                                                       
000009 MAHENDRA GAREWAL                                                       
000010 20000 N                                                                
000011 /*                                                                     
****** **************************** Bottom of Data ****************************

After we hit enter we get a message on the right had top corner - "Member COPYJCL1 created"
Which indicates that the create function was successful.

EDIT Line commands - BOUNDS


EDIT line commands - BOUNDS

BOUNDS 40 60 command will restrict the change window only to columns 40 to 60.
Any find or change command we issue will not be able to search any text beyond the data in the column rang 40 to 60.

This could be useful in cases where in we need to restrict our change only to specific columns.

TO remove the bound specified earlier we can just type BOUNDS on command line and hit enter.

Tuesday 12 March 2013

EDIT line commands - COPY


EDIT line commands- COPY


This is used to copy a dataset to the position marked by a A(after) or B(Before) line command or label.

Syntax:

COPY [member name] [AFTER]  label]
                   [BEFORE] 
COPY                will bring up a menu to enter dataset name

To use copy first we type A (after) or B(before) on the line where we want to copy another member and then type the command COPY membername on the command line and hit enter.

XX00       M0001.EDW.TEST.JCL(TESTJCL1) - 03.14                  COPY pending
Command ===> copy sort001                                     Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //TESTJCL1 JOB (EWDS),'TEST JCL',NOTIFY=&SYSUID                        
b00002 //STEP0001 EXEC PGM=TESTPGM1                                           
000003 //STEPLIB DD DSN=CMN.TEST.STG.#001621.LOD,DISP=SHR                      

In the above example we have placed a B at line two and typed 'copy sort001' on the command line. Hitting enter will cause the member sort001 to be copied before line 2.

In the below example we have created a label with name .m on the line 3. Then we type the command 'COPY SORT001 AFTER .M' on the command line and hit enter. This will cause the member to be copied after line labeled with .M

XX00       M0001.EDW.TEST.JCL(TESTJCL1) - 03.14           Columns 00001 00072
Command ===> copy sort001 after .M                            Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //TESTJCL1 JOB (EWDS),'TEST JCL',NOTIFY=&SYSUID                        
000002 //teststep EXEC PGM=TESTPGM1                                           
.M     //STEPLIB DD DSN=CMN.TEST.STGO.#001621.LOD,DISP=SHR                    

We can just use COPY command on the command line to get a selection panel where in we can browse to the datasets we want to copy.
In the below example we have typed A on line 4 indicates that we have to copy data after line 4. Then we type COPY on the command line to get a PDS selection panel as below:

  Menu  RefList  Utilities  Help                                               
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
XX00                           Edit/View - Copy                               
Command ===>                                                                  
                                                                   More:     +
"Current" Data Set: M0001.EDW.TEST.JCL(TESTJCL1)                             
                                                                              
From ISPF Library:                                                             
   Project . . .                                                              
   Group . . . .          . . .          . . .          . . .                 
   Type  . . . .                                                               
   Member  . . .                (Blank or pattern for member selection list)  
                                                                              
From Other Partitioned or Sequential Data Set, or z/OS UNIX file:             
   Name . . . . . 'M0001.EDW.TEST.JCL'                                      +
   Volume Serial . .           (If not cataloged)                             
                                                                               
Data Set Password  . .          (If password protected)                       
                                                                              
Line Numbers (Blank for entire member, sequential data set or z/OS UNIX file) 
   First line  . . . .                                                        
 F1=Help      F2=Split     F3=Exit      F7=Backward  F8=Forward   F9=Swap     
F10=Actions  F12=Cancel                                                       

Highlighted is where we provide the PDS name and hit enter. It will bring the list of all members in the pds as shown below

  Menu  Functions  Utilities  Help                                            
ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
XX00 Extended Copy to M0001.EDW.TEST.JCL(TESTJCL1)         Row 00001 of 00024
Command ===>                                                  Scroll ===> CSR 
   Name     Prompt          Size    Created           Changed            ID   
. SMATN603                    63   2003/02/12   2013/01/04 09:12:55    M0001 
S SMCCC803                    11   2006/06/06   2013/02/06 09:47:14    M0001 
. SMCTN807                    32   2005/07/14   2013/02/07 07:15:56    M0001 

Enter 's' against the member we want to copy and hit enter. This member will get copied to the original member.