Showing posts with label TSO basics. Show all posts
Showing posts with label TSO basics. Show all posts

Wednesday, 13 March 2013

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.

Sunday, 10 March 2013

Changing CASE using UC and LC



UC
Change text from lowercase to uppercase
LC
Change text from uppercase to lowercase

We can use command CAPS ON on the command line so that everything we type automatically converts to capitals.

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.12           Columns 00001 00072
Command ===> CAPS ON                                          Scroll ===> CSR 
****** ***************************** Top of Data ******************************

EDIT Line commands - Flow fragments of text into a paragraph



TF
Flow text to the end of paragraph which is either a blank line or an indentation.
TFn
n is the column number. This will flow the text using the column number as the right margin

Type command TF on the line as shown below

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.09           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
000005 //           DCB=(LRECL=80,RECFM=FB,BLKSIZE=)                          
000006 //SYSIN   DD *                                                         
tf0007 12                                                                      
000008 SUKUL                                                                  
000009 MAHADIK                                                                
000010 35000                                                                   
000011 Y                                                                      
000012 30                                                                     
000013 DUSHYANT                                                               
000014 JADAV                                                                  
000015 67000                                                                  
000016 Y                                                                      
000017 40                                                                      
000018 MAHENDRA                                                               
000019 GAREWAL                                                                
000020 20000                                                                   
000021 N                                                                      
000022 /*                                                                     
****** **************************** Bottom of Data ****************************

Type enter and we get following output

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
000005 //           DCB=(LRECL=80,RECFM=FB,BLKSIZE=)                          
000006 //SYSIN   DD *                                                         
000007 12 SUKUL MAHADIK 35000 Y 30 DUSHYANT JADAV 67000 Y 40 MAHENDRA GAREWAL 
000008 20000 N /*                                                              
****** **************************** Bottom of Data ****************************

If we use a column number 20 as the right margin we use the command TF20

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.09           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
000006 //SYSIN   DD *                                                         
tf2007 12                                                                      
000008 SUKUL                                                                  
000009 MAHADIK                                                                
000010 35000                                                                  
000011 Y                                                                      
000012 30                                                                     
000013 DUSHYANT                                                               
000014 JADAV                                                                   
000015 67000                                                                  
000016 Y                                                                      
000017 40                                                                      
000018 MAHENDRA                                                               
000019 GAREWAL                                                                
000020 20000                                                                   
000021 N                                                                      
000022 /*                                                                     
****** **************************** Bottom of Data ****************************

Hitting enter gives following output. Note that right margin is restricted to column position 20

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
000006 //SYSIN   DD *                                                         
000007 12 SUKUL MAHADIK                                                       
000008 35000 Y 30 DUSHYANT                                                    
000009 JADAV 67000 Y 40                                                       
000010 MAHENDRA GAREWAL                                                       
000011 20000 N /*                                                             
****** **************************** Bottom of Data ****************************


 

EDIT Line commands - Splitting text on multiple lines


TS is the command used for splitting lines.

Suppose we have text as below and wish to split the line number 2 starting at  the text 'TEST'.

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 THIS IS A TEST LINE                                                    
000002 THIS IS A TEST LINE 2                                                   
000003 THIS IS A TEST LINE 3                                                  

Type TS on the line 2 , place the cursor on the word TEST and hit enter.

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 THIS IS A TEST LINE                                                     
TS0002 THIS IS A TEST LINE 2                                                  
000003 THIS IS A TEST LINE 3                                                  

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 THIS IS A TEST LINE
000002 THIS IS A                                                               
000003 TEST LINE 2                                                            
000004 THIS IS A TEST LINE 3                                                  

To split the line and add 4 lines in between, we suffix the command TS with the number (number of lines)

TSn Split a text line at the cursor and insert n number of lines 

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 THIS IS A TEST LINE                                                    
000002 THIS IS A                                                              
000003 TEST LINE 2                                                             
TS4004 THIS IS A TEST LINE 3                                                  

After hitting enter following is what I get follows

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 THIS IS A TEST LINE                                                    
000002 THIS IS A                                                              
000003 TEST LINE 2                                                            
000004 THIS IS A T                                                            
''''''                                                                         
''''''                                                                        
''''''                                                                        
''''''                                                                         
000005 EST LINE 3                                                             

EDIT line commands - Shifting data right and left


< commands are data shift commands
( commands are column shift commands

<
(
Shift this line left two positions
<n
(n
Shift this line left n positions
<<
((
Shift a block of lines left two positions
<<n
((n
Shift a block of lines left n positions
 >
)
Shift this line right two positions
>n
)n
Shift this line right n positions
>>
))
Shift a block of lines right two positions
>>n
))n
Shift a block of lines right n positions

Following is how the >> command is written:

 XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR 
 ****** ***************************** Top of Data ******************************
 >>8001 //DWJ030C0       EXEC PGM=TESTPGM1                                      
 000002 //MINPUT  DD DSN=M0001.TESTFILE.MASTER2,DISP=(OLD,CATLG,CATLG),       
 000003 //           DCB=(LRECL=80,RECFM=FB,BLKSIZE=)                          
 >>8004 //SYSIN   DD *                                                         
                                                  

Hitting Enter will give us below output

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //DWJ030C0               EXEC PGM=TESTPGM1                             
000002 //MINPUT          DD DSN=M0001.TESTFILE.MASTER2,DISP=(OLD,CATLG,CATLG),
000003 //                   DCB=(LRECL=80,RECFM=FB,BLKSIZE=)                  
000004 //SYSIN           DD *                                                 

See that only the data portion is shifted 8 positions.
The stepname and DDNAME stay in place.

Following is how the )) command is written

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
))5001 //DWJ030C0       EXEC PGM=TESTPGM1                                     
000002 //MINPUT  DD DSN=M0001.TESTFILE.MASTER2,DISP=(OLD,CATLG,CATLG),       
000003 //           DCB=(LRECL=80,RECFM=FB,BLKSIZE=)                          
))5004 //SYSIN   DD *                                                         

Hitting enter will give us following output

XX00       M0001.D00.TEST.JCL(TESTJCL1) - 03.10           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001      //DWJ030C0       EXEC PGM=TESTPGM1                                
000002      //MINPUT  DD DSN=M0001.TESTFILE.MASTER2,DISP=(OLD,CATLG,CATLG),  
000003      //           DCB=(LRECL=80,RECFM=FB,BLKSIZE=)                     
000004      //SYSIN   DD *                                                    

Note that the data along with step name and DDNAME got shifted 5 places.