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.

Monday 11 March 2013

FTP(Part 10) - FTP in Batch.



Following is a simple FTP job(ftp in batch).

XX00       M0001.EDW.TEST.JCL(TESTSUKU) - 02.07           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //TESTSUKU JOB (EWDS),'FTP TEST'                                       
000002 //TESTFTP1 EXEC PGM=FTP,REGION=6144K,                                  
000003 //         PARM='199.145.85.37 (EXIT TIMEOUT 720'                      
000004 //SYSPRINT DD SYSOUT=*                                                 
.JCPA  //OUTPUT   DD SYSOUT=*                                                 
000006 //INPUT    DD *                                                         
000007  M0001 <username>                                                                
000008  jan9th       <password>                                                           
000009  put 'CMN.TEST.BASO.SRC(TEST111A)' 'M0001.test3.src(by14111a)'        
000010  quit                                                                  
****** **************************** Bottom of Data ****************************

REGION=2048K is a minimum requirement. The requirement could increase depending on the block size of the data set being transmitted.
For PARM=, you can specify any parameter that is valid when invoking FTP from your terminal.

You must include the following three DD statements:

SYSPRINT DD: Alternative name for the OUTPUT DD statement. You can use SYSPRINT DD in place of the OUTPUT DD statement.
OUTPUT DD: Specifies the data set where FTP is to place the client messages and server replies generated during the FTP session.
INPUT DD: Specifies the data set where the FTP subcommands to be performed are located.

Any client messages and server replies to the commands you execute appear in the OUTPUT DD data set. The SYSPRINT can contain some additional messages that relate to the execution of your FTP session.

Note: If you do not want your password to be copied to the output file, specify your user ID and password on separate input lines as shown in the above example.

Following example uses GDG as the target dataset.


XX00       M0001.EDW.TEST.JCL(DW646A0U) - 02.07           Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //TESTSUKU JOB (EWDS),'FTP TEST'                                       
000002 //DW646S04 EXEC PGM=FTP,REGION=6144K,                                  
000003 //         PARM='199.145.85.37 (EXIT TIMEOUT 720'                      
000004 //SYSPRINT DD SYSOUT=*                                                 
.JCPA  //OUTPUT   DD SYSOUT=*                                                  
000006 //INPUT    DD *                                                        
000007  M0001                                                                
000008  jan8th                                                                 
000009  put 'CMN.TEST.BASO.SRC(TEST111A)' 'M0001.src(+1)'                    
000010  quit                                                                  
****** **************************** Bottom of Data ****************************



After successful execution of the job following is what gets displayed in the output:

***************************** Top of Data ******************************
 EZA1736I FTP 199.145.85.37 (EXIT TIMEOUT 720                          
 EZY2640I Using /etc/ftp.data for local site configuration parameters. 
 EZA1450I IBM FTP CS V1R12                                              
 EZA1772I FTP: EXIT has been set.                                      
 EZA1554I Connecting to:   199.145.85.37 port: 21.                     
 220-FTPSERVE IBM FTP CS V1R12 at MVSXX00.MVS.ABC.COM, 15:20:48 on 1453-
 220 Connection will close if idle for more than 5 minutes.            
 EZA1459I NAME (199.145.85.37:M0001):                                 
 EZA1701I >>> USER M0001                                              
 331 Send password please.                                              
 EZA1789I PASSWORD:  <note that password was not displayed>                                                  
 EZA1701I >>> PASS                                                     
 230 M0001 is logged on.  Working directory is "M0001.".             
 EZA1460I Command:                                                     
 EZA1736I  put 'CMN.TEST.BASO.SRC(TEST111A)' 'M0001.src(+1)'          
 EZA1701I >>> SITE FIXrecfm 80 LRECL=80 RECFM=FB BLKSIZE=27920         
 200 SITE command was accepted  < note that implicit SITE command was generated. We can also execute the SITE command explicitly to specify the dataset attributes>                                        
 EZA1701I >>> PORT 199,145,86,233,73,152                               
 200 Port request OK.                                                  
 EZA1701I >>> STOR 'M0001.src(+1)'                                    
 125 Storing data set M0001.SRC.G0001V00                              
 250 Transfer completed successfully.                                  
 EZA1617I 314528 bytes transferred in 0.005 seconds.  Transfer rate 6402
 EZA1460I Command:                                                      
 EZA1736I  quit                                                        
 EZA1701I >>> QUIT                                                     
 221 Quit command received. Goodbye.                                   
**************************** Bottom of Data ****************************


In following example the remote server name is not passed as PARM, instead written as the 1st line on the input dataset

***************************** Top of Data ******************************
//TESTSUKU JOB (EWDS),'FTP TEST'                                       
//DW646S04 EXEC PGM=FTP,REGION=6144K,                                  
//         PARM=' (EXIT TIMEOUT 720'                                   
//SYSPRINT DD SYSOUT=*                                                 
//OUTPUT   DD SYSOUT=*                                                 
//INPUT    DD *                                                        
 MVSXX00.MVS.ABC.COM                                                   
 M0001                                                                
 jan8th                                                                 
 put 'CMN.TEST.BASO.SRC(TEST111A)' 'M0001.src(+1)'                    
 quit                                                                  
**************************** Bottom of Data ****************************



NOte : All the information about FTP and the syntax diagrams are taken from the site http://publib.boulder.ibm.com.
Things are put here in simplified words and Many commands that are not used normally are omitted.
Refer the website http://publib.boulder.ibm.com. in case you need more details.

FTP(part 9) - FTP file transfer commands


FTP file transfer commands

Append
Use the APpend subcommand to append a local data set to a remote host.

>>-APpend--local_data_set--destination_file--------------------><

local_data_set :The name of the data set on your local host to be appended.
destination_file: The name of the file on the remote host to which your data set is appended. If the destination file does not already exist at the remote host, a new file is created.

DELETE
Use the DELETE subcommand to delete a file on the remote host.

Delete filename

GET
Used to copy a file from the remote host to your local host.

>>-Get--foreign_file--+------------+--+------------+-----------><
                      '-local_file-'  '-(--REPLACE-' 

foreign_file: Specifies the name of the file to be retrieved from the remote host.
local_file: Specifies the name of the local file created as a result of the Get subcommand.

If the current local working directory is a PDS, local_file is the name of the member in the PDS.

If the current local working directory is a data set prefix, the local file is a sequential data set with the local_file name appended to the current local working directory. 

If local filename is not specified then the file is created on the local server with same name as that on the remote server.
MDELETE
Used to delete multiple files.

         .--------------. 
         V              | 
>>-MDelete----foreign_file-+-----------------------------------><

foreign_file : Specifies the name of the file to be deleted on the remote host.

Because more than one file can be deleted with the MDelete subcommand, the foreign_fileparameter of the MDelete subcommand can be repeated many times, with each foreign_fileseparated by a blank space.
MGET
Use the MGet subcommand to copy multiple files from a remote host to your local host and create a corresponding number of local files.

         .--------------.                 
         V              |                 
>>-MGet----foreign_file-+--+------------+----------------------><
                           '-(--REPLACE-' 

Foreign_file: Specifies the name of the file to be retrieved from the remote host.

Because more than one file can be copied with the MGet subcommand, the foreign_fileparameter of the MGet subcommand can be repeated many times, with each foreign_fileseparated by a blank space.

You can use special characters for pattern matching when specifying the foreign_file with the MGet subcommand.

Mget abc* à will get all the files starting with abc
MPUT
 MPut subcommand to copy multiple data sets from your local host to the remote host.

         .----------------. 
         V                | 
>>-MPut----local_data_set-+------------------------------------><

Local_data_set: Specifies the name of the file on your local host being sent to the remote host.

Because more than one data set can be copied with the MPut subcommand, thelocal_data_set parameter of this subcommand can be repeated many times, with eachlocal_data_set separated by a blank space.

You can use the asterisk (*) character for pattern matching when specifying the local_data_set with the MPut subcommand.


PUT
 PUt subcommand to copy data sets from your local host to the remote host.

>>-PUt--local_file--+--------------+---------------------------><
                    '-foreign_file-' 

local_file: Specifies the name of the file on your local host being sent to the remote host.
foreign_file: Specifies the name that the delivered data set is given on the remote host. If the foreign_file name is not specified, the foreign_file name is the same as the local_file name.

RENAME
Use the REName subcommand to rename a file, data set

>>-REName--original_name--new_name-----------------------------><




NOte : All the information about FTP and the syntax diagrams are taken from the site http://publib.boulder.ibm.com.
Things are put here in simplified words and Many commands that are not used normally are omitted.
Refer the website http://publib.boulder.ibm.com. in case you need more details.