Loading from the Command Line

Navigation:  Table of Contents > Using EasySMF > Loading SMF Data >

Loading from the Command Line

Previous pageReturn to chapter overviewNext page

Data can be loaded into the repository from the Windows command line using the EasySMFLoad utility. You can use EasySMFLoad to create batch files to automate loading data.

 

Syntax

 

C:\>EasySMFLoad repository-location smf-data-file

 

repository-location is the location of the EasySMF data repository to contain the data. The location of the current repository is displayed in the title bar in the main EasySMF application.

 

smf-data-file is the file containing the data to be loaded. If the file name is "-" data will be read from standard input. This allows you to pipe data to EasySMFLoad from another program, without creating an intermediate file.

 

If the folder or file names contain spaces enclose them in quotes.

 

Supported File Types

 

EasySMFLoad can load data from the following file types:

 

Raw SMF data. The records must include the RDW with the record length information e.g. transferred using the 'SITE RDW' FTP option.

Blocked SMF data. This is the same as the previous format except that the block descriptor word (BDW) is included. Data transferred as RECFM=U for SAS is in this format.

TSO transmit format. TSO transmit encodes the data into 80 byte records, avoiding the variable length record problems with the file transfer. The encoded records include the information required to reconstruct the original data.

 

Data can be compressed with Gzip and it will be detected and uncompressed automatically.

 

Data read from standard input must be unblocked SMF records including RDW.

 

Samples

 

Several sample batch files for use with EasySMFLoad are located in folder C:\Program Files (x86)\EasySMF\Samples. They can be accessed via the Windows Start Menu using Start -> All Programs -> EasySMF -> Samples.

 

loadfile.bat

 

loadfile.bat is a sample batch file to load SMF data into a repository from a local file.

 

@echo off

 

REM      Sample batch file to load SMF data from a file into EasySMF

 

REM      Make the following changes:

REM      - replace your-repository with the path to your EasySMF data repository

REM      - replace your-data-file with the path to your SMF data file

REM      - The ERRORLEVEL statement is an example of how to check whether

REM        loading data was successful. ERRORLEVEL 0 indicates success.

 

REM      The path is updated to include the EasySMF program folder to make

REM      the EasySMFLoad command simpler.

 

PATH="C:\Program Files (x86)\EasySMF";%PATH%

 

REM      Load the data...

 

EasySMFLoad "your-repository" "your-data-file"

 

REM      An example of checking the ERRORLEVEL

 

IF %ERRORLEVEL% NEQ 0 echo An error occured loading SMF data

loadfile.bat

 

loadftp.bat

 

loadftp.bat demonstrates downloading SMF data from a z/OS system using the Windows command line FTP client, then loading it into the repository. The FTP command uses the "/s" option to run the FTP script from file loadftp.txt.

 

@echo off

 

REM      Sample batch file to download SMF data using Windows command line

REM      FTP and load it into EasySMF

 

REM      Make the following changes:

 

REM      - replace your-repository with the path to your EasySMF data repository

 

REM      - localfile.smf is a sample file name. If you change it, ensure that 

REM        the FTP script loadftp.txt is changed to match

 

REM      - Make the following changes to the script in loadftp.txt

REM         - Change hostname to your hostname

REM         - Change userid to the userid to use for FTP

REM         - Change password to the appropriate password

REM         - Change SMF.DATASET.NAME to the desired SMF dump dataset

 

REM      The ERRORLEVEL statement is an example of how to check whether

REM      loading data was successful. ERRORLEVEL 0 indicates success.

 

REM      The path is updated to include the EasySMF program folder to make

REM      the EasySMFLoad command simpler.

 

PATH="C:\Program Files (x86)\EasySMF";%PATH%

 

REM      The file loadftp.txt contains the FTP commands

 

ftp -s:loadftp.txt

 

REM      Load the downloaded file into EasySMF

 

EasySMFLoad "your-repository" "localfile.smf"

 

REM      An example of checking the ERRORLEVEL

 

IF %ERRORLEVEL% NEQ 0 echo An error occured loading SMF data

 

REM      Delete the downloaded file

 

del localfile.smf

loadftp.bat

 

loadftp.txt

 

loadftp.txt contains the FTP command script used by batch file loadftp.bat.

 

open hostname

user

password

quote site rdw

quote site readtapeformat=s

bin

get 'SMF.DATASET.NAME' localfile.smf

quit

loadftp.txt

 

ftpjcl.txt

 

ftpjcl.txt contains JCL to download SMF data to a FTP server using a z/OS batch job. This file could then be loaded using EasySMFLoad.

 

//JOBCARD  JOB

//*                                                                   

//* Make the following changes:                                       

//* hostname: Name of the remote FTP server                           

//* user: Userid on the remote system                                 

//* password: Password for the remote system                          

//* SMF.FILE.NAME: Name of the SMF dump dataset on z/OS               

//* pcfile.smf: The name of the destination file on the remote system.

//*                                                                   

//FTP EXEC PGM=FTP,PARM='(EXIT'      

//INPUT DD *                         

hostname                         

userid

password

locsite rdw                          

locsite readtapeformat=s             

binary                               

put 'SMF.FILE.NAME' pcfile.smf

quit                                 

ftpjcl.txt