--------------------------- Week 10-B Notes for DAT2330 --------------------------- -Ian! D. Allen - idallen@idallen.ca Remember - knowing how to find out the answer is more important than memorizing the answer. Learn to fish! RTFM! (Read The Fine Manual) These notes are largely based on lectures by Harold Smith: - DAT2330 - Harold Smith Class - Wed Jan 26, 2000 ----------- Writing JCL ----------- - commas at end of third field continue lines to next card - column 4-16 Rules for Continuation: see IBM Reference Manual - embedded blanks either cause JCL errors or cause trailing items to be takes as "comments" and ignored - BE CAREFUL WITH BLANKS! - un-learn your English habit of putting blanks after commas! -------------------------- Blocking Control: BLKSIZE= -------------------------- Blocking is necessary to avoid wasting space on output device: - bit->byte(character)->field->record->dataset(file)->database - Can put multiple logical records into one physical disk block. - Gaps between blocks on disk/tape may be several hundred bytes long - poor usage of space - MVS lets you adjust block size - logical record vs. physical record - blocking factor (number of grouped logical records) - how many logical records per physical block? - Exercise: if your record is 80 bytes, how many fit in a 4K block? 4096/80 = 51 records per block (integer truncate; do not round!) 51 records use up 4080 bytes of the 4K (16 bytes wasted per block) - if your record is 100 bytes, how many fit in a 4K block? 4096/100 = 40 records 40 records use up 4000 bytes of the 4K (96 bytes wasted per block) - some devices have a block size other than 4K (e.g. ANSI tapes) - adjust your calculations accordingly ----------------------------- Fragmentation Control: SPACE= ----------------------------- Supose I know that a file will grow to some size; can't reserve space in Windows - files fragment all over the disk platters. MVS will let me reserve size; if my job overflows the given space, we can specify how much new space to allocate. We usually care about allocation, since that's why we use MVS. (You really care about allocation when you're allocating tens or hundreds of millions of data items!) SPACE= ; how to allocate space on output device "Extents" - a dataset is allocated a "primary" extent of disk space and some number of "secondary" extents for "overflow" - you specify the size of the primary and secondary extents in the JCL when you first create the dataset; the sizes are remembered from then onward - number of secondary extents is limited to 15 unless SMS in in use ------------------------------------- IDCAMS - how to copy a dataset (file) ------------------------------------- - the MVS IDCAMS utility can copy a file (among other things) - IDCAMS has half a dozen operations! - IDCAMS is a "DEBE - Did Everything But Eat" program - Unix would have separate commands for the functions in IDCAMS - need a way to pass program options to programs such as IDCAMS - Windows: can specify moves and copies depending on shift and ctrl keys! - copy/move/shortcut behaviour also depends on destination! - is that intuitive and user-friendly? - Unix: uses command-line flags to influence program behaviour - DOS: uses comand-line switches to do same thing - OS/390: IDCAMS reads its options from a file (dataset) - that "file" can be read from the JCL input stream itself, similar to a Unix shell "Here Document", hence "instream" data - the /* indicates the end of the instream data (like EOF in Unix) - the SYSIN DDname specifies the dataset that IDCAMS will read to get its control statements that tell it what to do - most IBM-written utilities read from DDname "SYSIN" - REPRO - specifies what thing IDCAMS will do (of the many) - REPRO means "copy" in IBM-speak jargon - the REPRO line must be indented one or more spaces - this REPRO line is *not* a line of JCL; it is *input* to IDCAMS - REPRO specifies the JCL DDnames of the input file and the output file, instead of using the file names themselves - you can choose your own REPRO DDnames as long as they match your JCL DDnames (follow the syntax and length restrictions) - I always use INFILE(IN) and OUTFILE(OUT) because they are simple - IDCAMS produces status messages on DDname SYSPRINT - most IBM-written utilities produce status output on DDname "SYSPRINT" - we always need 4 DDnames for a REPRO operation: SYSIN, SYSPRINT, IN, OUT - every I/O unit must have a DD statement in MVS