** c:\tmp\SMAN.TXT *** SELCOPY Rel 2.00 L=083 --- 2003/08/14 17:34:13 (L05) Sourced from: ** g:\cd\sm980\SMAN.DOC L=083 --- 2003/08/14 17:31:46 (P21) ____________________________________________ | | | S E L C O P Y | | | | | | Release 2.0x | | | | | | U S E R M A N U A L | |____________________________________________| _______________________________ | | | MULTIPLE | | INFORMATION RETRIEVAL | |_______________________________| Platforms *-***-* Architecture Operating Systems SELCOPY Release ------------ Mainframe: S/390 & zSeries IBM OS/390 (inc TSO) IBM z/OS IBM VM/ESA (CMS) IBM z/VM IBM VSE/ESA 2.00 Midrange: AS/400 & iSeries IBM OS/400 2.08 UNIX: RS/6000 & pSeries IBM AIX 2.08 SUN SPARC SUN Solaris 2.08 COMPAQ ALPHA COMPAQ Tru64 2.08 HP PA-Risc HP-UX 2.08 PC: Intel x86 Microsoft MS-DOS Microsoft Windows 95/98/ME Microsoft Windows NT/2000 IBM PC DOS IBM OS/2 WARP 2.08 _______________________________________________________ | | | | | COPYRIGHT | | | |_______________________________________________________| Copyright in the whole and every part of this document and of the SELCOPY system and programs is owned by Compute (Bridgend) Ltd, whose registered office is located at 8 Merthyr Mawr Road, Bridgend, Wales, UK, CF31 3NH, and who reserve the right to alter at their convenience the whole or any part of this document, or the SELCOPY system and programs. No reproduction of the whole or any part of the SELCOPY system and programs, or of this document, is to be made without prior written authority from Compute (Bridgend) Ltd. Disclaimer At the time of publication, this document is believed to be correct. Where the program product differs from that stated herein, Compute (Bridgend) Ltd reserve the right to revise either the program or its documentation at their discretion. CBL do not warrant that upward compatibility will be maintained for any use made of this program product to perform any operation in a manner not documented within the user manual. *** _______________________________________________________ | | | | | Contents | | | |_______________________________________________________| Line Number ------ 25 Platforms 791 **CBL Overseas and AGENTS 842 **Changes Since previous Manual 1097 **INTRODUCTION 1104 General 1147 MAINFRAME Version 1159 AS/400, UNIX and PC Versions 1174 New Computer-user 1237 Bits and Bytes explained 1262 Hexadecimal explained 1306 Packed Decimal explained 1349 Zoned Decimal explained 1388 New SELCOPY-user 1825 **CONTROL CARD SYNTAX RULES 2132 **CONTROL CARD SUMMARY 2555 **Notes on Control Card Summary 2652 **Operation Words, Parameters 2710 ! (Default separator character) 2720 * (Comment) 2740 *< (Comment Ignoring Separator) 2755 *> (Comment in Summary) 2772 /* (End of file indication for control statements) 2807 \ (Control Statement Continuation) 2855 ABTRAP 2889 ADABAS 2930 ADD=n 3019 ALL 3025 AND (Operation Word) 3053 AND=string (Logical Operator) 3164 APPEND 3198 ASA0 3216 ASC 3232 ASCII 3240 ASSGN 3246 AT=p 3267 BANNER 3293 BASE=xxxx 3311 BDW 3330 BLKSIZE=n (for Input) 3469 BLKSIZE=n/SAME/MAX/UNB (for Output) 3603 BUFNO 3622 BWD 3656 BY=n 3674 CALL modname 3689 CALL (for Mainframe) 3877 CALL (for UNIX, Windows and OS/2) 4046 CANCEL (Operation Word) 4083 CANCEL (Parameter) 4095 CAT fname 4261 CAT=catref 4286 CHAR 4306 CHKP 4333 CIPHER 4345 CKPT 4366 CLEAR 4388 CLOSE fname 4418 CLOSE=disp 4459 CMS 4467 COMPRESS 4527 CONTMAX 4552 CP 4672 CVDATE 4738 CVxx=n Conversion Synonyms 4782 CVAE=n (ASCII --> EBCDIC) 4836 CVBC=n (Binary --> Char) 4904 CVBP=n (Binary --> Packed) 4942 CVCB=n (Char --> Binary) 4969 CVCF=n (Char --> Float) 4995 CVCH=n (Char --> Hex) 5078 CVCP=n (Char --> Packed) 5202 CVEA=n (EBCDIC --> ASCII) 5255 CVFC=n (Float --> Char) 5309 CVHC=n (Hex --> Char) 5360 CVPB=n (Packed --> Binary) 5465 CVPC=n (Packed --> Char) 5529 CYLOFL=n 5550 DATAWIDTH 5611 DB2 (Operation Word) 5629 DB2 (Parameter) 5643 DEFDIR=path 5686 DEFER 5702 DEL fname 5779 DEV=cuu 5805 DEV=dev 5898 DIR (General) 5919 DIR (for MVS) 6026 DIR (for CMS) 6082 DIR (for VSE) 6161 DIR (for AS/400, UNIX and PC) 6252 DIRDATA (General) 6316 DIRDATA (for CMS) 6404 DIRDATA (for MVS) 6433 DIRDATA (for VSE) 6505 DIRDATA (for AS/400, UNIX and PC) 6577 DIV=n 6738 DL1 6767 DO user-label 6793 DOS 6802 DSN 6809 DSN= 6924 DUMMY 6933 DUMPALL [= YES NO ] 6954 DUMPENC = "xy" "x" 6991 EBC 7007 EBCDIC 7015 ELSE 7039 ELSEIF 7059 END 7088 ENTRY 7110 ENTRYEOJ 7129 ENVFAIL 7158 ENVVAR 7175 EODISK 7186 EOF (Operation Word) 7240 EOF (Testing for) 7341 EOJ 7368 EOL (End-of-Line protocol) 7425 EOMEMB 7436 EQ 'string' 7471 EQU (Operation Word) 7559 ESDS 7593 EXACT 7608 EXCL 7621 EXIT='phasenam' 7654 EXPAND 7714 FAIL=NOCLOSE 7735 FILE=fname/keyword 7748 **4 types of FILE argument: 7792 FILE=DUMMY (logical) 7868 FILE=START (logical) 7904 FILE=STOP (logical) 7921 FILE=SUSP (logical) 7945 FILE=CARD 8030 FILE=STDIN 8083 FILE=STDOUT 8125 FILE=JECL 8153 FILE=LOG 8245 FILE=PLOG (Print and LOG) 8269 FILE=PRINT 8438 FILE=PUNCH 8457 FILE=TAPEnn 8506 FILE=fname 8559 FILE=#nnn 8576 FILE=fn.ft.fm 8637 FILE=fileid 8722 FILL=x 8799 FLAG 8821 FLAG EOMEMB 8847 FLAG EODISK 8877 FNAME 8884 FORMAT='string' 9063 FMT=column-list 9078 FROM=p 9110 FWD 9135 GE 'string' 9158 GEN=n 9300 GET fname 9306 GOSUB 9312 GOTO GET/EOJ/CANCEL/user-label 9334 GOTO GET 9342 GOTO EOJ 9363 GOTO CANCEL 9389 GOTO user-label 9423 GT 'string' 9444 HEAD='string' 9560 IF 9656 IF (Type 1 - Character Strings) 9815 IF (Type 2 - Arithmetic) 9918 IF (Type 3 - Specials) 9989 IMS 9995 IN 10001 INCLUDE fileid 10039 INCOUNT=n 10117 INPUT 10123 INS fname 10244 INTO=n 10283 INTV=n 10295 ISAM 10334 ISN 10345 JECL 10353 KEY= 10490 KEYFROM=n 10518 KEYLEN=n 10563 KEYPOS=n 10623 KGE= 10632 KL=n 10638 KP=n 10644 KSDS 10665 L 10672 label 10678 LABEL=NO 10712 LE 'string' 10739 LEAVE 10750 LENGTH=n 10769 LINE=n 10841 LOG 10849 LOWER 10860 LRECL 10872 LRECL (1. as a position) 10880 LRECL (2. as an Operation Word) 10992 LRECL (3. as a Parameter for Files) 11091 LT 11119 LTM=YES 11139 MARC 11243 MIXED='string' 11278 MOD (Redundant word) 11313 MOVE=n 11396 MSTIND 11413 MULT=n 11532 NE 11565 NEWBLK 11600 NL 11606 NOASA0 11625 NOBANNER 11652 NOBDW 11675 NOENVVAR 11697 NOFILL 11710 NODUP 11723 NOPRINT 11759 NORDW 11801 NOSORT 11814 NOSUB 11827 NOSUBS 11839 NOTRUNC 11874 NOW (Redundant word) 11917 NULLS 11935 ONES='string' 11955 OPEN fname 12066 OPEN=RWD/NORWD 12096 OPTION 12277 OR (Operation Word) 12317 OR= 'string' (Logical Operator) 12358 PACK=n 12364 PACKB=n 12370 PAD=x 12380 PAGEDEPTH 12412 PAGEWIDTH 12496 PASS=x'nnnn,nnnn,nnnn,nnnn' 12521 PASSWORD=string 12545 PERFORM user-label 12552 PFX 12571 PLOG 12579 POS (Discussed under 3 headings) 12588 POS (1. as an Operation Word) 12600 POS=p1 (,p2) (2. as a Parameter with Numeric Arg) 12699 POS=p1 (,p2) (3. as a Parameter with Special Keyword) 12733 POS @ 12760 POS @user 12791 POS ANY 12819 POS CBLNAME 12838 POS COMRG 12862 POS DATE 12903 POS DIFF 12950 POS DSN 13004 POS FHDR 13022 POS FNAME 13052 POS FSIZE 13077 POS FT 13095 POS HEAD 13129 POS L 13180 POS PARM 13219 POS PCB 13251 POS PGNO 13260 POS RBA 13283 POS RETCODE 13306 POS RETSYS 13346 POS RETVSAM 13382 POS RETXV 13393 POS RPL 13426 POS SEG 13438 POS SQLCA 13490 POS SQLDA 13545 POS SQLMA 13587 POS STATUS 13595 POS UPSI 13611 POS UXADIFF 13641 POS UXATPTR 13679 POS UXDW 13688 POS UXINCNT 13709 POS UXINCNT+4 13715 POS UXLINE 13731 POS UXLINEREM 13740 POS UXLRECL 13766 POS UXLRECL+4 13773 POS UXPD 13782 POS UXPGNO 13809 POS UXPW 13818 POS UXREPLYL 13884 POS VOLID 13939 PRINT 13950 PRRECLEN=NO/YES 13980 PRT 13986 PRTCTL 14001 PTR=@user 14025 PUNCH 14033 QUIT 14039 RANGE=yyyy/mm/dd-yyyy/mm/dd 14072 RBA=n 14132 RC_KEYNF=n 14157 RDW 14193 READ fname 14336 REC=n (Testing for) 14343 REC=n (Reading by) 14415 RECFM= 14586 REM=n 14606 REP 14613 REPLY=n 14700 REPORT 14828 RESET 14834 RETCODE 14914 RETURN 14935 REUSE 14959 REVERSE 14983 RKP=n 15004 RRDS 15047 S=n 15053 SEARCH 15112 SEG 15142 SEP x 15172 SEQ=dd 15179 SITE='string' 15212 SIZE=n 15228 SLEEP 15275 SORT=sort-list 15307 SORTDIR=x 15350 SPACE=n 15379 SQL='full SQL statement' 15414 SSA 15447 SSN=xxxx 15468 STACK 15519 START 15525 STARTISN= 15533 STARTKEY= 15592 STARTRBA=n 15638 STARTREC=n 15676 STEP=n 15774 STOP 15780 STOPAFT=n 15834 SUB=n 15922 SUBDIR=n 15958 SUSP 15964 SYS=n 16002 SYSTEM 16096 TAB=n 16129 TABLE= 16151 TABSIN/TABSOUT 16176 THEN 16205 THENIF 16228 TIMES=n 16244 TO=n 16262 TRAN 16340 TRUNC 16383 TYPE=x (for Data) 16415 TYPE=x (for Printing) 16457 TYPE=B (for Printing) 16526 TYPE=C (for Printing) (Default for AS/400, UNIX, PC PRINT) 16589 TYPE=D (for Printing) 16713 TYPE=DX (for Printing) 16723 TYPE=H (for Printing) 16736 TYPE=M (for Printing) 16805 TYPE=MP (for Printing) 16857 TYPE=N (for Printing) (Default for mainframe PRINT) 16935 TYPE=S (for Printing) (Default for LOG) 17047 UNIX 17055 UNPK=n 17061 UNPKB=n 17067 UPD (Parameter) 17114 UPD fname (Operation Word) 17224 UPPER 17235 user-label 17241 UTIME 17297 UXxxxxxx 17303 VLEN 17323 VOL=volser 17342 VSAM 17372 VTOC 17422 WHERE=where-clause 17444 WORKLEN=n 17494 WRITE fname 17646 WTO (Operation Word) 17655 WTO (Parameter) 17683 XOR='string' 17717 XV func 17910 Y2 17942 ZEROS='string' 17987 **FURTHER INFORMATION 18020 Nesting of Operation Words 18062 Abbreviations and Synonyms 18132 Comment Data 18168 Separator Character 18197 Continuation Character 18226 Redundant = Sign 18253 Redundant FILE= 18270 Redundant NOW 18290 Comparison Operators 18339 Data v Data Comparison 18375 Literals for Arithmetic 18392 Literals for String Compares 18416 Literals for PRINT/LOG/Output Files 18431 Writing Variable Length Data 18480 Changing Record Formats 18557 Dynamic Allocation 18671 Multiple Input Files 18764 Automatic EOJ 18781 Forced EOJ 18831 Processing with no Input File 18861 Execution via VSE Console 18905 SYSIN for MVS and CMS 18941 ENQ/DEQ for PDS Output 18971 Monitor MVS Operator STOP command 18984 Bit Testing - ON/OFF/MIXED 19072 Bit Modification - OR/XOR/AND 19107 Selection Summary Format 19326 **Pointers and LRECL - Discussion 19384 Range Tests 19398 Pointer Assignment - Indirect 19431 Pointer Assignment - Direct 19490 Pointer Value testing 19560 Pointer Usage Considerations 19605 Setting a Pointer from an Address Constant 19652 Getting a Pointer Value into Workarea 19670 @ Pointer Example 19741 **CBLNAME & SELCNAM 19751 CBLNAME Overview 19790 SELCNAM Overview 19928 CBLNAME Options 20209 **Mainframe Debugging Aids 20247 ABEND Trap Set ON 20331 ABEND Trap Set OFF 20415 Avoiding Loops 20437 The SELCOPY Query Desk 20458 **ISAM Files 20463 ISAM Input - Sequential 20487 ISAM Input - Direct 20503 ISAM Update 20516 ISAM Output - Blocked 20530 ISAM Output - Unblocked 20622 **TSO Usage 20673 TSO Example 1 - S CLIST 20763 TSO Example 2 - CLIST 20838 TSO Example 2 - in action 20903 TSO Example 3 - CLIST 20970 TSO Example 3 - in action 21065 TSO Example 4 - SCANPDS 21196 **The User EXIT (Obsolete) 21219 Conventions 21286 Example of User EXIT 21379 **Mainframe Machine Requirements 21384 Computer Type 21391 Control Program 21400 Main Storage 21452 Peripheral Devices 21462 Number of Phases/Modules 21485 Installation 21492 ZAP Material 21521 **VSAM Files 21581 The IDCAMS DEFINE 21594 VSAM Managed SAM Files 21621 VSAM Operations 21673 VSAM Parameters 21834 VSAM use of LRECL/RECFM 21884 VSAM Input LRECL 21897 VSAM Output LRECL 21980 Direct Processing after EOF 21992 Empty VSAM files for MVS 22034 VSAM Example 22052 **IMS and DL/1 Processing 22087 Execution 22126 Terminology 22188 Special Position Keywords for DL1/IMS 22205 Syntax without SSA 22372 Syntax with SSA 22410 Record Length 22441 Work Area 22467 STATUS Codes 22509 MPS Usage 22522 ERROR Checking 22561 CHKP Calls 22585 Different DBD for same DB 22601 Printing 22628 Direct Processing after EOF 22640 Looping on GU 22665 **IMS/DL1 Examples 22672 DL1 Example 1 - Read 22684 DL1 Example 2 - Read using SSA 22708 DL1 Example 3 - Unload/Load 22739 DL1 Example 4 - Delete 22757 DL1 Example 5 - Insert 22797 DL1 Example 6 - Replace 22821 DL1 Example 7 - Use of Work Area 22853 DL1 Example 8 - Generalised Print 22947 **DB2 Processing 22989 Introduction 23029 Concepts and Terminology 23134 Execution 23175 Identifying the DB2 Subsystem 23202 Running a SELCOPY in Different DB2 Subsystems 23274 Concurrent Read Limit 23290 Concurrent Insert Limit 23304 Using Statement Continuation 23327 Special Position Keywords for DB2 23346 The CBLSQLOG log file 23365 DB2 Example 1: Normal SQL Execution 23475 DB2 Example 2: Run Time Error RC=8 23588 DB2 Example 3: Run Time Error with SQLCA Test 23646 SELCOPY SQL I/O Area format 23706 Generating SELCOPY EQU statements 23724 DB2 Example 4: Accessing the SQLDA 23814 DB2 Example 5: Ctl Cards for generating EQU statements 23984 DB2 Example 5: Output file 24014 Ctl Cards for generating LOAD statements 24024 Direct READ of DB2 Tables 24052 SELCOPY SQL Error Handling 24073 DB2 Example 6: DB2 Connect Failure 24141 DB2 Example 7: DB2 OPEN Failure 24225 RC=8 Suppression 24247 SQL Warnings from PREPARE 24311 SELCOPY SQL Statement Types 24387 Reading DB2 Tables 24406 READ - Type 1 24565 READ - Type 2 24610 READ - Type 3 24628 UPDATE of Current Row 24691 DELETE of Current Row 24731 Prepared INSERT 24807 The DB2 Operation 24878 **ADABAS Processing 24902 Installation 24917 Commands 24944 FORMAT='string' 24959 FORMAT=ALL 24969 SEQ dd 24979 Record Length Returned 24999 ADABAS Control Block 25018 ISN=n 25035 LRECL=n 25045 STARTISN=n 25058 KEY 25074 STARTKEY 25092 SEARCH 25127 EXCL 25135 PASS 25144 CIPHER 25150 Direct Processing after EOF 25173 **AS/400, UNIX and PC Processing 25202 AS/400, UNIX and PC Environments 25219 SELCNAM (Mainframe CBLNAME Equivalent) 25280 FILE=PRINT Output Fname 25306 AS/400 native printer file 25344 Command Line Parameters 25382 Command Line Options 25442 Command Line Control Cards 25474 Fileids 25512 AS/400, UNIX and PC I/O 25537 RECFM for AS/400, UNIX and PC files 25673 Direct Read for AS/400, UNIX and PC 25775 Binary Field Interpretation 25796 %ENVVAR% for literals or File names 25846 ASCII/EBCDIC Differences 25879 AS/400 automatic ASCII to EBCDIC conversion 25903 The APPEND Parameter 25914 The TRUNC/NOTRUNC Parameter 25924 Issuing AS/400, UNIX and PC/DOS Commands 25958 **VM/CMS Processing 25984 DOS ON or OFF ? 26036 Native CMS I/O 26048 CMS Filename Notation 26103 CMS File Mode 4 26125 RECFM for CMS files 26199 RECFM=FB/VB Special Meaning 26218 Lower Case Commands 26238 SELC EXEC 26276 SELCCTL EXEC 26312 Read CMS File - Print and Log 26343 The APPEND Parameter 26354 The TRUNC/NOTRUNC Parameter 26370 XV - Transfer Variable 26440 The CLEAR parameter 26460 Issuing CMS commands 26501 Issuing STACK commands 26538 Issuing CP commands 26572 Last Command issued 26619 Direct Read for CMS 26677 Direct Processing after EOF 26689 SELCRDR - Read off RDR Queue 26724 SELCCKD - Read Guest VSE/MVS File (with DOS OFF) 26791 SELCFBA - Read Guest FBA (DOS ON) 26854 SELCVSAM - CMS with VSAM 26899 CMS Update-in-Place 26960 CMS use of DIR input 26992 CMS use of DIRDATA 27033 FLAG with DIRDATA 27053 CMS with IMS/DLI 27105 CMS Distribution Material 27177 **EXAMPLES 27191 Example 1 - Card Reformatted to Print 27246 Example 2 - Tape Copy and Print 27263 Example 3 - Tape Format, Copy & Print 27305 Example 4 - Use of GOTO 27349 Example 5 - Variable to Fixed Length 27380 Example 6 - DA Disk to Tape & Print 27431 Example 6a - Sequential Disk to VSAM 27460 Example 7 - Use of @ Pointer 27463 **Match 2 Files Out Of Seq 27549 Example 8 - VSAM Dump/Restore 27626 **Backup 6 VSAM Files to 1 Tape File 27709 Example 9 - RECFM=V from Card 27793 Example 10 - Compare 2 Files 28308 **MESSAGES 28335 **CONTROL CARD Errors 29041 **SELECT TIME Errors 29595 **SELCOPY SQL Messages 29675 **WARNING Messages at EOJ 29789 **TAPE ERRORS for VSE 29817 **RETURN CODES set by SELCOPY *** _______________________________________________________ | | | | | CBL Overseas and AGENTS | | | |_______________________________________________________| Germany: PLUS-DATA GmbH Kundenservice Charlottenstr 75 D-40210 DUSSELDORF Germany Tel: +49 (2685) 98 9013 Fax: +49 (2685) 98 9017 UK and Other Countries: COMPUTE (Bridgend) LTD 8 Merthyr Mawr Road BRIDGEND Wales CF31 3NH Tel: +44 (1656) 65 2222 Fax: +44 (1656) 65 2227 Note: CBL's North America office in Toronto was closed on. 1998/01/31. All North American business is now handled through the UK headquarters. Email Addresses: support@cbl.com Technical Support (All platforms). admin@cbl.com General Administration and Invoicing. sales@cbl.com Up-to-date CBL software prices. sman@cbl.com Comments on this User Manual. selcopy@cbl.com all other correspondence. Web Address: http://www.cbl.com *** _______________________________________________________ | | | | | Changes Since previous Manual | | | |_______________________________________________________| The previous SELCOPY manual was for Mainframe Rel 9.8, UNIX and PC Rel 2.01 which was last updated in April 1998. Changes and new features since then, which are now incorporated into the body of this manual, are summarised below. Note that these changes and new features may be subject to minor alteration, at the discretion of CBL, according to advice and feed-back from users. So please feel free to let us have your suggestions and requirements. Mainframe SELCOPY Introduced in Rel 9.8P (March 1999): The SELCNAM file. *IMPORTANT* OPT SITE='string' parameter. *IMPORTANT* OPT PASS=x'nnnn,nnnn,nnnn,nnnn' parameter. *IMPORTANT* OPT RANGE=yyyy/mm/dd-yyyy/mm/dd parameter. *IMPORTANT* 4 digit year for VM/VSE DIR. *IMPORTANT* OPT Y2/Y4 support. OPT CONTMAX support. CBLC5050 CBLNAME field. New Error Messages: 001, 153, 154 Introduced in Rel 2.00 (May 2001): PRINT output changes for TYPE=B,C,D,M. *IMPORTANT* ASCII/EBCDIC Translation changes. *IMPORTANT* PAGEWIDTH=nnn changes. *IMPORTANT* OPT DATAWIDTH supported. POS UXREPLYL supported. Control card length restriction relaxed for MVS and CMS SYSIN. Changes to default SELCOPY output listing. AS/400,_UNIX_and_PC_SELCOPY Introduced in Rel 2.02 (June 1998): NORDW made default for RECFM=V input. *IMPORTANT* Platform supported: HP-UX and OS/2. REVERSE Range Test. RECFM=V2 supported. RECFM=MFV supported. NOBDW for RECFM=V files supported. Introduced in Rel 2.03 (September 1998): OPT RANGE=yyyy/mm/dd-yyyy/mm/dd parameter. *IMPORTANT* POS FHDR supported. Arithmetic: 31-digit for Packed Decimal. Control Statement Maximum LRECL increased to 512. Larger SELCOPY.NAM file supported. Unsupported Keywords tolerated. Introduced in Rel 2.04 (May 1999): Platform supported: AS/400. Platform supported: Windows 95/98/ME/NT/2000. INCLUDE statement supported. Syntax: Comments to summary using *> supported. OPT BAN/BANNER and NOBAN/NOBANNER supported. FILL=x or NOFILL for RECFM=U input files. Print TYPE=DX for Hex Only Dump PRINT. AS/400 stdin redirection with "<". AS/400 native printer file. AS/400 auto ASCII/EBCDIC conversion of text input file. Introduced in Rel 2.05 (October 1999): UPD statement (Update in place). GEN statement (Generate random data). %ENVVAR% system environment variables for literals or Fnames. OPT ENVFAIL = SAME/NULL/CANCEL supported. OPT ENVVAR/NOENVVAR supported. Syntax: Allow POS 3 +2 -1 to mean POS 4. POS VOLID for Volid of current disk volume. Short last RECFM=F input record now gives actual length for LRECL. Introduced in Rel 2.06 (August 2000): RECFM=U input LRECL=0 no longer treated as LRECL=1. *IMPORTANT* EOF and RC=8, not ERROR 571, when file not found. *IMPORTANT* "C++" to "C" for CALL Shared Library source, slccall. *IMPORTANT* DEFER is no longer default for Output files. *IMPORTANT* CAT statement (Concatenate files). READ/WRITE DSN=n AT p (Dynamic Allocation). Syntax: LRECL = 0 assignment allowed. Syntax: @A = 0 (Allow any value for @ptrs). Syntax: IF @A = NULL supported. Syntax: END statement treated as /* (End of Ctl Statements). Euro Currency Symbol printable. LOG REPLY support for UNIX, but not AS/400. Number of open files restriction for DOS and Windows removed. CALLed C/C++ sub-routines DLL for Windows and OS2. OPT FILL=x or NOFILL for SELCOPY.NAM file. Network Machine UNC "\\" filename prefix supported. Arithmetic: Error Processing for field overflow and validity. Record returned at EOF/CLOSE. NOTRUNC the default if EOL=NO coded. Allow "/*" as end of file on FILE=CARD if column 3 is blank. Default LOG length changed from 79 to 80. Start of execution SELCOPY Banner Format changed. New Error Messages: 031, 157, 158, 159, 160, 161, 570, 580. Introduced in Rel 2.07 (February 2001): MASK test bug fixed. *IMPORTANT* SYSTEM statement return code reflected in RETSYS (RETCMS). UTIME statement to Update file Timestamps. CVDATE NOW TO DATECB statement. SLEEP statement to pause processing. SPACE with no argument treated as SPACE 1. Introduced in Rel 2.08 (August 2003): DIR/DIRDATA sub-directory input suppressed. See also: SUBDIR. *IMPORTANT* Default file extension ".FIL" removed. (Applicable to PC only.) *IMPORTANT* DIFF position following different length field compare *IMPORTANT* UXADIFF now in Big Endian format. *IMPORTANT* Syntax: Continuation Character "\" supported. *IMPORTANT* PRINT TYPE=D output default format changed. *IMPORTANT* DIFF value testing. Expiry Date displayed correctly in SELCLST footer. Expiry Date warning message output to console. 8-byte POS UXATPTR for 64-bit machines Command line options "-ctl", "-lst", "-log" and "-V". stdin and stdout files for streamed input and output. FILE=CARD input no longer synonymous with FILE=SYSIN. @ pointer name length and total number DIR and DIRDATA input support for UNIX platforms. DIR and DIRDATA input SUBDIR/NOSUB parameter. DIR and DIRDATA input SORTDIR/NOSORT parameter. DEFDIR=path option for I/O Operations. DUMPALL and DUMPENC options for PRINT TYPE=D. POS VOLID for UNIX platforms. Default WORKLEN=80 if no input file and no WORKLEN option specified. SELCLST output changes to PRINT counting guide and footer. CVBx/CVxB up to 8-byte binary field conversion. POS RBA support for Relative Byte Address of current record. KEY, RBA and REC for Direct Reads on a Disk File. STARTKEY, STARTRBA and STARTREC for Disk Files. OPTION RC_KEYNF=n for the Key Not Found condition. ASC/EBC parameter on literals. POS UXREPLYL supported. POS UXLINE, UXLINEREM, UXPD, UXPW, UXDW supported. Floating Sign on FORMAT for CVxC. New Error Message: 166. *** _______________________________________________________ | | | | | INTRODUCTION | | | |_______________________________________________________| General *-***-* SELCOPY is primarily concerned with the reading, writing, manipulating and updating of files on IBM (or equivalent) mainframe, AS/400, UNIX and PC computers. Its intention is to insulate users whenever possible from the rigorous rules and tedious tasks found in data processing, thereby gaining productivity. Simple SELCOPY applications include: copying one file to another, modifying and manipulating input data, accumulating totals, writing modified data to a second output file, printing original data, new data and accumulated totals at the end of the run; and even interrogating the operator at execution time. Everything can be done on a conditional basis. Printing, copying and modifying may each be governed by different selection criteria. The number of conditions is not limited by SELCOPY, and may be as complex as the user wishes. One can even examine or alter down to the "Bit" level. The number of times a statement is to be actioned may be limited by the STOPAFT parameter, which is very useful in a testing environment. SELCOPY does not limit the number of output or input files which may be read, written or updated (as allowed by the Operating System) in a controlled sequence. Thus, match and merge, or match and update is simple with SELCOPY. The only limiting factor on the number of files, number of conditions and number of actions permitted within a SELCOPY run, is the machine size in which SELCOPY is operating. Flexibility of syntax has been given special attention. As a result, there are numerous methods of saying the same thing. For example, blanks, commas, or a combination of both are all acceptable for separating parameters. Arithmetic functions supported are addition, subtraction, multiplication and division for Packed Decimal or Binary data, while conversion functions include character, packed decimal, binary and hexadecimal notation. (Any type to any other.) MAINFRAME Version *-***-* The SELCOPY program was initially developed for all mainframe operating systems and consists of Basic Assembler Language modules. All mainframe SELCOPY code is independent of Operating System. The same program will work under all varieties of MVS, VSE, TSO and CMS. SELCOPY is ideal for developing systems under CMS or TSO for subsequent operational use in a Batch environment. AS/400, UNIX and PC Versions *-***-* See also: Section AS/400, UNIX and PC Processing. To open up the product for use on other platforms, the bulk of the mainframe SELCOPY program has been translated into the C++ language. SELCOPY is currently operational on INTEL x86/Pentium (or equivalent) machines running PC/DOS, MS-DOS, Windows 95/98/ME/NT/2000/XP and OS/2; Sun Sparc machines running Solaris; COMPAQ Alpha machines running Tru64 UNIX (Digital); RS/6000 machines running AIX; HP PA-Risc machines running HP-UX; and AS/400 machines running OS/400. New Computer-user *-***-* The first-time computer user may already be wondering what a file in computer terminology really means. To begin with, let us consider a "record": A Record is a string of numbers and/or letters representing information concerning a certain entity. This entity may be an employee with a name, address, age and salary. Alternatively, it could be a component description with a number indicating how many of these components are in stock in the warehouse at the moment. Records are also known as Logical Records. A Block is a number of logical records strung together. The concept of a block is meaningless to AS/400, UNIX and PC systems. However, on mainframe systems, records are stored on magnetic media in blocks in order to minimise the amount of space used by control information between blocks of data. Blocks are also known as Physical Records. A Data Set is a collection of records, which, for mainframes, may be blocked or unblocked, stored on a computer medium such as magnetic tape, magnetic disk, or even the now old fashioned punched cards. For AS/400, UNIX and PC systems, data sets can be stored on any magnetic media such as disk, tape, diskette, optical disk and CD-ROM. Normally, records in any one "data set" are all associated with the same type of entity. The "Payroll" data set only has records which describe employees. The "Stock" data set only has records describing warehouse stock. Control Card and Control Statement are terms used frequently throughout this manual to refer to a record which contains control information, a statement, directing SELCOPY as to what processing is to be done. Historically, SELCOPY's instructions were read off punched cards. Broadly speaking, each "data set" on a computer system is referred to by a unique name. In a mainframe environment, depending on the type of Operating System used by your machine, Job Control Language (JCL) of one type or another, is usually required to link a particular Data Set to a unique File name which may in turn be referenced in your SELCOPY control statements. In an AS/400, UNIX or PC environment, a data set may be referenced directly by its file identification name (fileid.) Therefore, for mainframe, a File is an abstract or logical concept of a collection of data. The data set referenced depends on JCL statements, supplied separately or generated by SELCOPY's Dynamic Allocation feature. For AS/400, UNIX and PC, a File is a collection of data referenced by a unique fileid. MVS users have a built-in facility in the JCL to concatenate (join together in a string) several Data Sets to form one File, which results in a need to differentiate between Files and Data Sets. Although VSE users now have the same facility via SELCOPY's CAT control statement, traditionally, data set concatenation was never available to them and data sets were always referred to as files. Usually in a mainframe environment, a file does refer to a single data set but long established confusion within the industry has resulted in the two being effectively treated as synonomous. Bits and Bytes explained *-***-* The computer memory consists of a series of switches known as "Bits" in either the ON or the OFF position. A combination of eight switches is called a "Byte", and one byte is used for each character on your keyboard. Note that data on IBM midrange (AS/400 and iSeries) and IBM compatible mainframe systems is transmitted using Extended Binary Coded Decimal Interchange Code (EBCDIC). In contrast, UNIX and PC operating systems transmit data using American Standard Code for Information Interchange (ASCII). Because of this, alphanumeric and special characters on IBM AS/400 and mainframe systems have different binary representations to those on UNIX and PC systems. The letter A, for instance, is stored in AS/400 and IBM compatible mainframe computer memory as 1100 0001, and in UNIX and PC computer memory as 0100 0001 (where 1 represents an 'on' bit, and 0 represents an 'off' bit). It is useful to be able to refer to a byte of data, and know its bit configuration. But using a string of 1's and 0's is laborious and leads to errors. For this purpose we use Hexadecimal Representation. Hexadecimal explained *-***-* The first four bits of any byte are, broadly speaking, coded to distinguish between numbers, letters and special characters. It is therefore convenient to split the byte into two groups of four bits. The highest possible value of a four digit binary number is 1111 which is equivalent to 15 in base 10. This means, that to represent this number as a single digit, we have to work in base 16. ________________________________________ | | || | | | Base 16 | || | | | (Hex) | Binary || Base 16 | | | | || (Hex) | Binary | | | || | | |_________|_________||_________|_________| | | || | | | 0 | 0000 || 8 | 1000 | | 1 | 0001 || 9 | 1001 | | 2 | 0010 || A | 1010 | | 3 | 0011 || B | 1011 | | 4 | 0100 || C | 1100 | | 5 | 0101 || D | 1101 | | 6 | 0110 || E | 1110 | | 7 | 0111 || F | 1111 | |_________|_________||_________|_________| If we refer to each group of four digits as a single hexadecimal (base sixteen) digit, we can then represent an eight digit number (one byte) with two hexadecimal digits. As we have already seen, the EBCDIC letter A is stored in AS/400 and IBM mainframe computer memory as 1100 0001. This can be represented in hex as X'C1', which tells us that the first two and the last bits are on, and all the rest are off. Similarly, the ASCII letter A, stored in UNIX and PC computer memory as 0100 0001, can be represented in hex as X'41', which tells us that the second and the last bits are on, and all the rest are off. We distinguish hex numbers from other data by enclosing them in quotes and preceding them with an X. It is important to realise that hex and character format are for our benefit only. The computer does everything at the bit level. Packed Decimal explained *-***-* Although packed decimal is not inherent to AS/400, UNIX and PC environments, SELCOPY for AS/400, UNIX and PC fully supports this form of numeric field. It is, in fact, the default numeric field type used by all SELCOPY arithmetic functions. A single digit number is stored in the memory of the computer as an eight bit binary field. The first four bits are coded to signify a numeric value, i.e. binary 1111 (X'F') for AS/400 and mainframe, binary 0011 (X'3') for UNIX and PC. However, if we already know that we are dealing with a number, the code becomes unnecessary, and the first four bits are only wasting valuable storage space. To save this storage space we "pack" the data - that is we leave out the coded bits - thus reducing the storage space needed by half. Consider the numeric string '987': Normally it would be stored as X'F9F8F7' for AS/400 and mainframe, and X'393837' for UNIX and PC, but if we pack the data it becomes X'987C', and we have saved one byte of storage. The X'C' (or 1100 in binary) denotes a Positive value, while a Negative value is normally represented by X'D'. The hex values X'A', X'C', X'E' and X'F' are all valid Positive codes. The hex values X'B' and X'D' are both valid Negative codes. So to summarise with an example: The representation '2' (in IBM Assembler Language, shown as C'2' for Character 2) has precisely the same meaning as the representation X'F2' on AS/400 and mainframe computers, and X'32' on UNIX and PC computers. This is because AS/400 and mainframe machines process it as simply eight switches set as 11110010, and UNIX and PC machines as eight switches set as 00110010. The representation X'2C' to us means the same thing, because we recognise it as Packed Decimal data holding the number 2. But to the computer it is totally different. It is a combination of eight switches set as 00101100. Packed decimal data is unprintable and must therefore be converted (unpacked) into a character representation, called Zoned Decimal, before it can be printed. Zoned Decimal explained *-***-* Zoned Decimal representation uses a full byte for each numeric digit, but the junior (right-most) byte is zoned according to the sign of the complete numeric string, thus differentiating between positive and negative values. As we saw above, the first four bits (left-most) of a byte are coded to signify a numeric value by having all four bits either set to binary 1111 (X'F') for AS/400 and mainframe, or binary 0011 (X'3') for UNIX and PC. These "first four bits" are known as the Zone portion of a byte, while the last 4 bits (right-most) are known as the Numeric portion of a byte. Only the junior (right-most) byte of a zoned decimal string may be zoned to indicate the sign, or to be more precise, it is only the junior byte which is used for defining the sign. All other zones on other bytes in the string are ignored for arithmetic purposes. Conveniently, the sign representations for zones are identical to those used for Packed Decimal data: The hex values X'A', X'C', X'E' and X'F' are all valid Positive codes. The hex values X'B' and X'D' are both valid Negative codes. SELCOPY will always use X'F' for positive because the character so generated is printable on AS/400 and IBM mainframe machines. SELCOPY for UNIX and PC, performs an EBCDIC to ASCII translation on the zoned byte so that the same character is printed for UNIX and PC as would be printed in a mainframe environment. Thus +1 +2 through to +0 in the junior byte will print as 1 2 3 4 5 6 7 8 9 0. SELCOPY will always use X'D' for negative because this is traditionally the standard. Thus -1 -2 through to -9 in the junior byte will print as J K L M N O P Q R, and the byte containing -0 (X'D0') will print as a "brace" (right-hand curly bracket) on some printers, but on others it will be unprintable. New SELCOPY-user *-***-* See also: READ, WRITE and FILE in section Operation Words, Parameters and Keywords. Copying a complete file from one disk to another is achieved by the following two control statements: READ FILE=A WRITE FILE=B SELCOPY will obey the control statements you supply in the sequence that you supply them. SELCOPY does not read the whole file at once. It could well be too big to get into the machine storage. SELCOPY reads the file one record at a time and applies all your control statements to each record individually. On reaching the last of your control statements, it loops back to the first one and reads another record off the input file which again has all your control statements applied to it. Thus your control statements are obeyed once for each input record, and this will continue until all records from the input file have been processed. The File names A and B could of course be other names of your own choosing, making the statements more meaningful for your particular application. The length of the file name is however limited by the type of Operating System under which you are using SELCOPY. If at the same time you want the file printed then the control statements become: READ FILE=A WRITE FILE=B WRITE FILE=PRINT Abbreviations and Synonyms -------------------------- But already it is becoming tedious to have to repetitively key in the fact that 'A' and 'B' are files. Surely SELCOPY should know that they are files because we are either reading or writing them. This should also be true of a printer file. YES - this assumption is made by SELCOPY, and users may omit the FILE= on all READ and WRITE statements. Also the word WRITE may be omitted for the PRINT output. Thus, the above example could be rewritten as: READ A WRITE B PRINT Even further, for the ultimately lazy, READ may be abbreviated to RD, WRITE to WR, and PRINT to PR. You will see later that many such abbreviations and synonyms are available to you. Different users of SELCOPY may have different programming backgrounds, and as such may prefer to use the term GET instead of READ. When SELCOPY was first written in 1971, the only keyword for reading an input file was INPUT, which of course is still supported. The word IN then became the first abbreviation. In the same way, the word WRITE may be replaced with PUT, OUTPUT or OUT. So again we can rewrite the above example: GET A PUT B PRINT For the purposes of this introduction however, we will stick to the words READ and WRITE. It is hardly worth continuing to use FILE= any longer, so further examples will omit it. Selection --------- Usually it is unnecessary to print every record that is being copied, so you could very easily restrict the printing to only certain records: READ A WRITE B IF POS 20 = 'XYZ' THEN PRINT SELCOPY processes the above set of control statements in sequence. The READ statement causes file 'A' to be read. This really means that the first record is read from file 'A'. So as well as having data recorded on file 'A', we now also have a copy of the first record stored in the machine memory under control of SELCOPY. The WRITE statement causes file 'B' to be written. Again, this really means that one record is written to file 'B'. The data used for writing this record is taken from SELCOPY's input area in the machine memory. The IF statement causes the data starting at position 20 of the input area, (arbitrary position chosen for this example), to be checked for equality with the characters XYZ, which will result in a true or false condition. The THEN statement is ignored for false conditions, but actioned for true conditions. Action in this case would cause the data held in the input area in the machine memory to be printed. Later you will see that you can modify and move around this data held in the input area before writing it to file 'B' or printing it. Having reached the end of your control statements, SELCOPY goes back to the beginning to repeat the operation. This time the READ statement will cause the second record of the file to be processed. And so it goes on until finally the end of the input file is reached. At this point SELCOPY prints totals of how many records it read from file 'A', wrote to file 'B' and printed. The Selection Summary is described below. Multiple Selection ------------------ Similarly, records written to file B could be restricted: READ A IF POS 20 = XYZ THEN WRITE B IF POS 20 = XYZ THEN PRINT Note that this time the quotes around XYZ were omitted. Quotes around a string of characters are optional, provided the string does not contain blanks, commas, quotes, asterisks or lower case characters. But the output to file 'B' and to the printer are based on identical conditions, so it is better written as: READ A IF POS 20 = XYZ THEN WRITE B THEN PRINT There is no restriction on the number of THEN statements that follow an IF statement other than the amount of machine storage available to SELCOPY for storing details of your control statements. Similarly you may have as many IF statements and as many output files as you require. Later, you will see that you can also have as many input files as you require, but for the time being it is easier to restrict yourself to a single input file. Other Control Statements ------------------------ At this stage, other control statements in SELCOPY may become meaningful with little need to reference this manual: READ A IF POS 6 NE 'XYZ' AND POS 42 = ',' THEN PRINT THEN POS 42 = ' ' * Modify it to blank. THEN PRINT THEN LOG STOPAFT=6 WRITE B BLKSIZE=800 All records that are Not Equal (NE) to 'XYZ' in positions 6 through 8, and also have a comma in position 42, are printed. i.e. the data stored in the input area at that time is printed. Position 42 of the input area for these records is then modified to blank and the input area is printed again. So these records are printed twice, once before modification and once after. Records that do not satisfy the IF/AND condition are not printed or modified. Also conditional on the IF/AND is the THEN LOG which is similar to print, but instead of printing to a real printer device or a print file on disk, it writes the data from file A to the operator's log device which is a screen, allowing quick verification that the job is running as expected. STOPAFT=6 as you have guessed means stop after this action has been taken 6 times. All records are written to file 'B' because the WRITE statement is unconditional. i.e. it did not have the word THEN in front of it which would have made it conditional on the IF/AND combination preceding it. Note that some of the records written to file 'B' have been modified first. Blocked Files ------------- The BLKSIZE=800 in the above example tells SELCOPY that records written to file 'B' are not to be physically transferred to the output medium immediately, but stored until enough of them are available to build up a block of length 800 bytes. Thus for records of length 80 bytes there will be no physical data transfer to the file 'B' until 10 logical records are stored. At that point, one physical record, known as a block, is written to the output file 'B'. Mainframe --------- In mainframe environments, input files are usually blocked, so it is essential SELCOPY knows the Logical RECord Length in bytes, (LRECL), in order to process a single record at a time. MVS and CMS users are fortunate because this information is available to SELCOPY from details stored by these operating systems when the file was created. VSE users are obliged to supply this LRECL information themselves on the control statement that mentions the input file: READ OLDMAST LRECL=100 WRITE NEWMAST BLKSIZE=3600 STOPAFT=50 Omission of LRECL by VSE users will result in SELCOPY making the assumption that the input logical record length (LRECL) is 80 bytes. For output files, the default assumption is made that the logical record length (LRECL) is the same as that of the input file. A STOPAFT of 50 indicates that only 50 records are to be written to the file 'NEWMAST'. SELCOPY will, therefore, terminate the run prematurely without reading any more records than necessary from the file OLDMAST, than are required to write 50 of them to the file NEWMAST. AS/400, UNIX and PC ------------------- The concept of storing data in blocks is meaningless for most AS/400, UNIX and PC files. However, data is still transferred to the output medium in discrete amounts as specified by the BLKSIZE parameter. Input files for AS/400, UNIX and PC, are usually character data files with LRECL defined as the length of data delimited by EOL (End of Line) character(s). The EOL character(s) may be defined by the user or allowed to default to any type of standard line-end protocol. These are typically Carriage Return/Line Feed (CR/LF) for PC's (X'0D0A') and AS/400 IFS (X'0D25'), and Line Feed (LF) for UNIX systems (X'0A'). Note that LRECL may be coded on I/O statements to read or write fixed length records (RECFM=F). In this case, if EOL characters exist, they are included as data within the logical records. The LRECL parameter should be used when reading or writing files containing binary data. Selection Summary ----------------- Automatically, SELCOPY will print a Selection Summary at the end of every execution. This summary gives you a count of how many times each selection was actioned. Your selections are numbered by SELCOPY when it prints out your control statements. This automatic selection summary can be useful if for control purposes you require to count the number of records on a particular file. In the above example however, you must give SELCOPY something to justify reading beyond record 50, even if it is only a dummy output file. READ OLDMAST LRECL 100 WRITE NEW BLKSIZE=3600 STOPAFT=50 WRITE DUMMY * Comments allowed on any statement, * but must be preceded by "*". DUMMY is a reserved file name which indicates that no data transfer is to take place. Thus no file is actually created, but you still get a total of the number of times SELCOPY obeyed the WRITE DUMMY command. In this case the total will be the same as the number of input records read, but consider the following: READ PAYROLL LRECL 248 * Get an input record. IF POS 25 = A OR POS 25 = M OR POS 25 = D THEN GOTO GET * Go back to 1st ctl stmt. PRINT STOPAFT=20 WRITE DUMMY The THEN GOTO GET statement causes SELCOPY to ignore subsequent control statements and loop back to the first control statement to read or "get" the next logical record. The total for the dummy file will therefore only reflect those records that do not have A, M or D in position 25. In the case of a control card that causes no file I/O, comments may be reproduced on the corresponding Selection Id in the Selection Summary, by coding '*>' instead of '*' before the comment data. The real example below illustrates the layout of the Selection Summary. Later, you may wish to refer to the section Further Information for a detailed description of the Selection Summary. Selection Summary Example ------------------------- __________________________________________________________________________________________________________________________________________ | | | SELCOPY/WNT 2.08 at CBL - Bridgend UK (Internal Only) 2002/08/23 14:15 PAGE 1 | | o ----------------------------------------------------- ---------------- -------- o | | | | | | o ** SMXINT01.CTL *** L=001 --- 2001/10/23 10:10:20 (P24) o | | | | | | o 1. READ D:\S\200\MFR\INSTALL\CBLNAME.MAC INTO 21 WORKLEN 333 ** The CBLNAME assembler macro on CD-ROM ** o | | | | 2. PRINT 'CBLNAME Macro Parameter Default Field Name Offset Product OpSys' STOPAFT 1 | | o 3. PRINT '----------------------- ------- ---------- ------ ------- -----' STOPAFT 1 o | | | | 4. POS LRECL+21, 200 = ' ' * Blank out residue from previous, longer records. | | o o | | | | IF POS 21 = '.***' * Header for CBLNAME Macro parameter name. | | o 5. THEN MOVE 34 FROM 26 TO 201 * Store the parameter higher up in work area. o | | 6. THEN GOTO GET * No further checking required for this record. | | | | o o | | IF POS 21 = '.*' * Assembler macro comment record. | | AND POS 69 = 'SELCOPY' * Description of fields applicable to SELCOPY only... | | o AND POS 79 = 'MVS' * ..and MVS only. o | | 7. THEN MOVE 34 FROM 201 TO 1 * Overwrite 1st 14 bytes of latest record with CBLNAME parameter. | | 8. THEN PRINT LEN 100 *> Print all matching records. | | o o | | | | INPUT SEL SEL 1 RECORD | | o RECNO TOT ID. 1 2 3 4 5 6 7 8 9 0 LENGTH o | | ----- --- --- ....,....0....,....0....,....0....,....0....,....0....,....0....,....0....,....0....,....0....,....0 ------ | | 1 1 2 CBLNAME Macro Parameter Default Field Name Offset Product OpSys 69 | | o 1 1 3 ----------------------- ------- ---------- ------ ------- ----- 69 o | | 264 1 8 DB2SubSys=character(4) DB2A CBLCDB2S X'044' SELCOPY MVS 61 | | 272 2 8 DB2Plan=character(8) CBLPLAN0 CBLCDB2P X'048' SELCOPY MVS 61 | | o 376 3 8 SVsamRc160=Error|Empty Error CBLSREL X'058' SELCOPY MVS 61 o | | 386 4 8 SDynallocFail=Error|Empty Error CBLSREL X'058' SELCOPY MVS 61 | | 518 5 8 SMVSBufIn=integer 0 CBLSBUFI X'060' SELCOPY MVS 61 | | o 525 6 8 SMVSBufOut=integer 0 CBLSBUFO X'061' SELCOPY MVS 61 o | | ....,....1....,....2....,....3....,....4....,....5....,....6....,....7....,....8....,....9....,....0 | | | | o SUMMARY.. o | | SEL-ID SELTOT FILE BLKSIZE LRECL FSIZE CI DSN | | ------ ------ ---- ------- ----- ----- -- --- | | o 1 4,154 READ CBLNAME 2048 72 U 4,154 D:\S\200\MFR\INSTALL\CBLNAME.MAC o | | 2----3 1 | | 4 4,154 | | o 5----6 235 o | | 7 6 | | 8 6 Print all matching records. | | o o | | | | ** SELCOPY/WNT 2.08.158 Licensed by Compute (Bridgend) Ltd +44 (1656) 652222 & 656466 ** | | o ** Expiry: 08 Jul 2003 ** o | |__________________________________________________________________________________________________________________________________________| Example: Introduction Work Area --------- So far, POS n has always referenced a position within the input record. This is fine for simple executions with a single input file. If however there is a second input file, or data manipulation is required, you need the ability to reference positions outside the current input record. To cater for this, it is possible to request that a record is read into a specific position within a work area which is common to all files. Thus you may read different files into different positions within the same work area. Parts of the work area which are not used for input data may then be used to store information or accumulate totals. The WORKLEN parameter, coded on the first READ statement, or on an OPTION statement, is used to indicate to SELCOPY the length of the work area required. READ ABC WORKLEN 2000 * Reads into pos 1 (default). READ XYX INTO 50 PRINT FROM 20 L 80 * Print data from 2 files, length 80. Job Control Language -------------------- You do of course also have to supply Job Control Language (JCL) statements. The essential one of course is the one which will invoke the SELCOPY program: // EXEC SELCOPY For VSE. // EXEC PGM=SELCOPY For MVS. SELCOPY For CMS, UNIX and PC. CALL SELCOPY For AS/400. Mainframe Only -------------- Unless SELCOPY's Dynamic Allocation is being used, other JCL is required to link the files, which were mentioned in your SELCOPY control statements, with real physical data stored on a computer readable medium. These are: DD statements for MVS users, ALLOC statements for TSO users, FILEDEF statements for CMS users, and TLBL, DLBL, EXTENT and ASSGN statements for VSE users. Detailed information on JCL is available in the IBM literature on that subject. Your Next Step -------------- You now have sufficient knowledge of SELCOPY to copy and/or print selected records from the most common type of computer based file. i.e. one that has a Fixed length record format for mainframe, and Undefined length record format for AS/400, UNIX and PC. The Control Card Summary, a few pages on, is intended as a quick reference table for the experienced user. Glance through it - you may find it useful, even at this stage. - but don't let it frighten you. Then browse through the manual without worrying about learning it. Do not try to absorb it all. Just read the bits that look interesting, or easy. Then look at the examples at the back of the manual. They may now begin to make some sense. Where you meet parameters and operations that you do not understand, go back and look them up in the body of the manual. *** _______________________________________________________ | | | | | CONTROL CARD SYNTAX RULES | | | |_______________________________________________________| 1. For MVS and CMS systems, length restriction for SELCOPY control statements is equal to the LRECL of the SYSIN control card input file, up to a maximum of 256 bytes. For RECFM=V input, the LRECL value includes a 4-byte Record Descipter Word (RDW) so the maximum control statement length will be the lesser of the allocated maximum LRECL minus 4, or 252 bytes. The RDW is ignored by SELCOPY for RECFM=V SYSIN. Similarly, any sequence numbers that exist in the last 8 bytes of the record are included in the LRECL value and reduce the control card maximum length value accordingly. Note that sequence numbers are also ignored by SELCOPY syntax checking. For VSE systems, if SELCOPY's control card file is RECFM=F (Fixed length records), then, reminiscent of the "Punched Card" days, the last eight bytes of each control statement are reserved for use as a sequence or identification field. i.e. card columns 73-80 for all types of control card input, except the 96 column card where the sequence field is in columns 89-96. SELCOPY will ignore this field for syntax checking, so it may contain anything. No sequence field is expected for RECFM=V and RECFM=U control statement input For AS/400, UNIX and PC systems, control statement input may be of any length up to 512 bytes. 2. SELCOPY has been developed so that the same syntax is supported across all systems. However, where keywords are coded that are not applicable or not yet supported in SELCOPY on a particular platform, the keyword is tolerated and ignored and processing continues provided no logic problem ensues. 3. For compatibility with earlier releases of SELCOPY, it is permissable to code ./ in positions 1-2 of any control statement. The ./ is treated as two blanks. 4. A comma (X'6B' EBCDIC, X'2C' ASCII), or an equals sign (X'7E' EBCDIC, X'3D' ASCII), in any position, is treated as blank (X'40' EBCDIC, X'20' ASCII) unless it is enclosed in single quotes (X'7D' EBCDIC, X'27' ASCII) or in double quotes (X'7F' EBCDIC, X'22' ASCII). 5. An asterisk (X'5C' EBCDIC, X'2A' ASCII) in position 1, or in any position which is preceded by a blank and is not enclosed in quotes, defines the start of comment data. The sequence field at the end of the statement defines the end of the comment. Comment data is ignored by SELCOPY for syntax purposes. If the comment ends with the continuation character (Syntax Rule 25) then the subsequent control card is read as comment data. 6. A card that is totally blank up to the sequence field is quite acceptable to SELCOPY. Its only effect is to increase the spacing on the SELCOPY print-out. 7. Multiple blanks or commas or combinations of both are treated as a single blank, unless enclosed in quotes. Hex strings are exceptions to this (Syntax Rule 17). 8. A word is defined as a sequence of characters with no intervening blanks, commas, equal signs, quotes or asterisks. Thus a blank, or its equivalent, delimits the beginning and end of a word. It is not necessary to delimit the beginning of the first word with a blank, so position 1 of the control statement may be used. Words may be supplied in Upper Case or in Lower Case, or even as a mixture of both. SELCOPY will ignore the case setting and process all words as upper case. Lower case literals which are not enclosed in quotes will be used as if they had been supplied in upper case. e.g. The word abc is the same as if ABC were coded. Exceptions to this rule are: Dynamic Allocation for mainframe SELCOPY, where upper casing of the filename on DSN= will occur whether it is supplied in quotes or not. (To disable this upper casing for CMS I/O, refer to section relating to CBLNAME switches later in this manual). AS/400, UNIX and PC File Names which do not undergo case translation by SELCOPY, thus eliminating the need to supply the lower, or mixed case file names in quotes. If lower or mixed case file names are unsupported (e.g. on FAT formatted PC drives), then upper casing is performed automatically by the operating system. 9. Delimiters within a word which is enclosed in quotes are processed as though they were not delimiters and considered to be part of the word. Words of this nature are later referred to as strings. Lower case strings will remain lower case. e.g. 'abc' is not the same as 'ABC' because of the quotes. abc however, is the same as 'ABC'. 10. A string literal may be enclosed in either Single quotes or Double quotes. Strings containing a single quote must be enclosed within double quotes and vice versa. e.g. PRINT 'Can use "QUOTE2" in a literal.' PRINT "Can use 'QUOTE1' in a literal." Alternatively, a quote in a string may be represented as two consecutive quotes, and the whole string enclosed in the same type of quote. This will not affect the maximum string length, as the two consecutive quotes are counted as one byte. e.g. PRINT 'Can use ''QUOTE1'' in a literal.' PRINT "Can use ""QUOTE2"" in a literal." 11. The first word on a SELCOPY control statement is normally an Operation Word such as READ, IF, THEN, ELSE, WRITE or END. The section CONTROL CARD SUMMARY illustrates the full list of operation words. Syntax alternatives are described in Abbreviations and Synonyms in section FURTHER INFORMATION. If no Operation Word is found, and the statement has only one word, it is treated as a user label, otherwise it is treated as a NOW (unconditional) operation. Certain exceptions to this, such as REPORT, NOP, PRINT, LOG etc are listed under GOTO user-label in section Operation Words, Parameters and Keywords. 12. The second and subsequent words are known as Parameters and may be supplied on control statements in any order. Abbreviations may be used where many parameters are required, or the EQU statement may be used to combine parameters. 13. Parameters normally consist of a keyword and an associated argument. Some parameters however, such as VSAM, DIRECTORY, NOTRUNC and APPEND, do not have an argument. The keyword and argument may be separated by an equals sign (X'7E' EBCDIC, X'3D' ASCII), with or without intervening blanks. Blanks on their own of course are equally acceptable, but for readability, this manual will often give examples using equals signs: READ XYZ LRECL=150 BLKSIZE=600 RECFM=F Additional, redundant commas or equal signs can therefore be used to enhance readability: ====TOTALRTN==== * Accumulate totals * ==RETURN== 14. An argument consisting of a decimal numeric value which is to be used as a length or position may be up to 10 digits long, with or without leading zeros. Machine architecture limits the numeric value to decimal 2,147,483,647 (X'7FFF,FFFF') which is the maximum value for fixed binary arithmetic. For lengths, this value is further limited to decimal 16,777,215 (X'00FF,FFFF) which is the maximum value for a single-instruction move or compare. The operators "+" and "-" for addition and subtraction are obeyed resulting in a value calculated at control statement interpretation time. No operators are supported for multiplication and division at this level. Operators with intervening blanks are supported in SELCOPY for AS/400, UNIX and PC only. For mainframe SELCOPY, no intervening blanks are allowed. The following example illustrates the only situation in SELCOPY where an intermediate comma is not treated as blank but is mandatory in order to terminate the first positional expression. e.g. IF POS +20 + 2 -1 -1, +30 +3 -3 = 'XYZ' means: IF POS 20 30 = 'XYZ' * A range test. EQU names may be used to provide part of the numeric expression. POS=0008 POS=8 POS 1+2+3+4-2 POS 300-292 POS EQUNAME+27-9 15. Other arguments are defined as strings. Strings may be of any length and may contain any character. Syntax Rule 25 describes use of the control card continuation character in long strings. Strings which contain the delimiters blank, comma, equals, asterisk or quote must be enclosed in quotes. The enclosing quotes do not count as part of the length of the string. GT 0008 * is the same as GT='0008' NE ABCDEF * is the same as NE='ABCDEF' EXACT='ABC,DEF X' * the quotes are needed. FILE=MASTER * is the same as FILE='MASTER' LT '''A''' * the string length is 3. 16. For compatibility with previous releases of SELCOPY, it is still permitted to use POS=* to represent POS=@. In this case, the asterisk will not be treated as the start of a comment field. Note however that while POS @ is valid, POS * will result in the asterisk defining the start of a comment. The POS=* notation however is obsolete and should be avoided. 17. If the string required cannot be represented in character form (contains characters which are not on the keyboard) then the option to specify the string in hexadecimal notation should be used. The 'bit' testing and manipulating facilities of SELCOPY are examples of where 'hex' notation is virtually essential. Each byte of the string is represented by two hexadecimal digits, the whole string is enclosed in quotes and prefixed with the letter X. If the number of hexadecimal digits is not a multiple of 2, a senior (leftmost) hexadecimal zero is added to the string. IF P 1 = ABC * \ IF P 1 = 'ABC' * | IF P 1 = X'C1C2C3' * Mainframe and AS/400. | mean the same. or | IF P 1 = X'414243' * UNIX and PC. / IF P 1 ONES=0000 * \ IF P 1 ONES='0000' * | IF P 1 ONES=X'F0F0F0F0' * Mainframe and AS/400. | mean the same. or | IF P 1 ONES=X'30303030' * UNIX and PC. / IF P 1 LT X'A' * \ IF P 1 LT X'0A' * | mean the same. * / IF P 1 NE '''' * \ IF P 1 NE X'7D' * Mainframe and AS/400. | mean the same. or | IF P 1 NE X'27' * UNIX and PC. / Long hexadecimal strings are notoriously difficult to read. To reduce this problem embedded commas are allowed within hex strings in SELCOPY control statements. For even more clarity, blanks are also permitted. These commas and blanks are totally ignored by SELCOPY, so the user may have as many of them as he may wish, placing them anywhere within the quotes. IF POS 4 = X'0000,123C 0000,456D' IF POS 4 = X'00,01,02,03,04' IF POS 4 = X'0000,05,06,0000' IF POS 4 = X'0,0,0,A,B,C,D,00,F' IF POS 4 = X',,,00,,,,0,,,0000000,,,A' IF POS 4 = X'4780,D172 1B88 D201,C112,D185' 18. A control statement causing file input is required in order to invoke SELCOPY's automatic looping back to the beginning of the control statements when it reaches the end. Because the first READ or OPTION statement defines the length of the input record area, or work area if WORKLEN is coded, it must be placed before any position is addressed, or any output file mentioned. With the exception of non-logic control statements such as OPTION, EQU, REPORT, NOPRINT etc, a READ statement, if used, should be the first control statement read by SELCOPY. 19. Output to at least one file must be present in a set of control statements. This output may be to the printer, the operator's console or even to FILE=DUMMY. 20. Each IF statement may be followed by as many AND/OR statements as required. 21. At least one THEN statement must follow each IF statement or its associated AND/OR statements. 22. If input data to SELCOPY is to be via the same device as the control statements, then an END must be the last control statement. 23. For users of VSE (both native and under CMS/DOS), CMS (VM/ESA 1.2 or earlier) and TSO, a /* statement, or its equivalent end-of-file indication which may be set by an EOF statement, is always necessary. Native MVS users may omit this statement, while users of CMS (VM/ESA 1.2.1 or later) require a null line. Users of AS/400, UNIX or PC may code a /* in pos 1,2 to indicate end of input control cards. All data following this statement is ignored (not even read in.) 24. It is sometimes irritating to use a whole card in order to code one SELCOPY statement. To overcome this, a separator character has been defined to indicate that the logical SELCOPY control statement ends there, and further data on that control record is to be treated as a new logical control statement. The separator character is not taken to be part of the record, and is not printed. It is only effective on control statements, so your data cards will remain unchanged. The default separator character is "Exclamation Mark" (X'5A' EBCDIC, X'21' ASCII). This may be modified to an installation default via an entry in CBLNAME or via an OPTION SEP= statement in SELCNAM. A temporary override may be specified for a SELCOPY job step, on any platform, by coding an OPTION SEP= statement at the beginning of the job step. IF P 8 NE ABC !THEN GOTO GET will produce IF P 8 NE ABC THEN GOTO GET 25. It can also be irritating to have to code extra SELCOPY statements due to control card width restrictions. To overcome this, a continuation character has been defined to indicate that the next control record is to be concatenated to the end of the current logical SELCOPY control statement. The continuation character is not taken to be part of the record, and is not printed. It gets replaced by position 1 of the continuation control statement, and is only effective on control statements, so your data cards will remain unchanged. The continuation character is a "Backslash" (X'E0' EBCDIC, X'5C' ASCII) as the last character of a control statement. PRINT 'THIS IS A LONGER TH\ AN NORMAL LITERAL \ FOR ILLUSTRATION' will produce PRINT 'THIS IS A LONGER THAN NORMAL LITERAL FOR ILLUSTRATION' *** _______________________________________________________ | | | | | CONTROL CARD SUMMARY | | | |_______________________________________________________| *** __________________________________________________________________________ | | SELCOPY Rel 2.0x Table 1. | |Op Word | Parameters (See: Notes on Control Card Summary) | |________|____________________________________________________________________| | | ( SITE=x PASS=X'n' RANGE=nn SEP=x CONTMAX=n NOPRINT )| | OPTION | ( WORKLEN=n ABTRAP=ON REPORT HEAD=str PAGEWIDTH=n PRTCTL )| | | ( EOF=xx RDW FILL=x ASA0 TABSIN=n PAGEDEPTH=n NOPCTL )| | | ( NORDW NOFILL NOASA0 TABSOUT=n DATAWIDTH=n NOPTOT )| | | ( DUMPALL=YES/NO DUMPENC="xy" DEFDIR=path )| | | ( BANNER NOBANNER BDW NOBDW ENVFAIL=x ENVVAR NOENVVAR )| | | ( SUBDIR=n NOSUB SORTDIR=x NOSORT RC_KEYNF=n )| |________|____________________________________________________________________| | | | | REPORT | (HEAD=string) (PAGEWIDTH=n) (PAGEDEPTH=n) (DATAWIDTH=n) | |________|____________________________________________________________________| | | | | NOPRINT| * NOPCTL+NOPTOT * | | NOPCTL | * No Print of Ctl cards. * No other parameters allowed. | | NOPTOT | * No Print of Summ Totals. * | | PRTCTL | * Print Ctl Cards, Reset NOPCTL. * | |________|____________________________________________________________________| | INCLUDE| fileid ** AS/400, UNIX and PC only ** | |________|____________________________________________________________________| | EQU | user-name string1 (string2 string3 .. string32) | |________|____________________________________________________________________| | EOF | )) * Any 2 "special" chars ** VSE only ** | |________|____________________________________________________________________| | userlab| * No parameters | |________|____________________________________________________________________| | | | | READ | fname (WORKLEN=n) * WORKLEN on 1st READ or OPTION card only. | | CAT | * Other params same as 'THEN READ'. (Table 2) | |________|____________________________________________________________________| | | | | | fname/TAPEnn (INTV=n) (DEV=device) ** VSE only ** | | CKPT | (OPEN=RWD/NORWD) (LABEL=NO * Tape only | | | (CLOSE=RWD/NORWD/UNLD) (LTM=YES) * Tape only | |________|____________________________________________________________________| | | ANY | ( = ) | | ( PTR @user ) * Range | | | POS | EQ | 'Litval' | ( @ ) * test | | | P p1 (,p2) | GT | (ASC/EBC) | ( REVERSE ) * only. | | | | LT |______________| ( STEP n ) * | | |___________________| LE | |_________________________| | | | NGT | n AT p3 | | | | | etc | | | | | n AT p1 | | P p3, p4 | | | | POS | | | ( FILL (X'40') ) | | IF | P p1 LEN n | ONES | LEN | ( PAD ) | | AND | LENGTH | ZEROS | P p3 L n | * Diff length | | OR | | MIXED | LENGTH | * compares only.| | THENIF |___________________|_______|______________|_________________________| | | n | | n * No mixed TYPEs. | | | ptr+n | | ptr+n * Length 4 only | | | 4/n AT p1 TY=B/P | op | 4/n AT p2 TY=B/P * for TYPE=B. | | |___________________|_______|________________________________________| | | | | | | EOF / DIR / DATA | | | |_______________________________________| | | | | | | ( (FILE) fname ) | | | IN/INCOUNT/REC | op | n | | | |___________________|_______|___________|____________________________| | | | | | | | LINE / RETCD | op | n | |________|___________________|_______|________________________________________| | (NOW) | | | THEN | * NOW is default - means unconditionally. | | ELSE | * Refer to Tables 2, 3 and 4. | |________|____________________________________________________________________| | CANCEL | | | QUIT | * No parameters. | |________|____________________________________________________________________| | (END) | * No parameters. (END is only reqd if input is CARD.) | |________|____________________________________________________________________| | /* | * Signals EOF on SYSIN/SYSIPT - does not get printed. | |________|____________________________________________________________________| *** __________________________________________________________________________ | |Param or | SELCOPY Rel 2.0x Table 2. | |Op Word |Op Word |Parameters (See: Notes on Control Card Summary) | |________|_________|__________________________________________________________| | | | fname/CARD/TAPEnn/DUMMY * Standard | | | | | fname VTOC/DIR/DIRDATA * Special | | | | | fname ISAM/VSAM/KSDS/ESDS/RRDS * Keyed | | | | | fname TABLE/SQL=string/n AT p DB2/SSN= * DB2 | | | | | Fn.Ft.Fm (DIR/DIRDATA) * CMS/LIBR | | | | | fileid/stdin (DIR/DIRDATA) * AS/400,UNIX,PC | | | | | dbname (#nnn/nnn) DL1 * IMS/DL1 | | | | | #nnn/nnn DL1/ADABAS * IMS/DL1/ADABAS | | | | READ | | | | | | (DSN=string/n at p1) * Dynamic allocation| | | | CAT | (VOL=volser) (CAT=vsamcat) * VSE Dynamic alloc | | | | | (DEV=cuu/TAPE) (SYS=nnn) * VSE Dynamic alloc | | | | | | | | | | (LRECL=n/V/U) (RECFM=F/V/U/FB/VB/V2/MFV) | | | | | (BLKSIZE=n) (INTO=p) (WTO=YES) (DEFER) (TRUNC) | | | | OPEN | (RDW/NORDW) (BDW/NOBDW) | | | | | | | | | | (SUBDIR) (SORTDIR) * AS/400,UNIX,PC | | | | | (KEYPOS=p) (KEYLEN=n) * CMS,AS/400,UNIX,PC | | | CLOSE | (KGE/KEY/STARTKEY=string/n AT p) * " KSDS/ISAM/ADABAS | | | | (REC/STARTREC=n (AT p (TYPE=x))) * " RRDS/ADABAS | | | | | (BWD) (PASS=string) * Any VSAM | | | | | (RBA/STARTRBA=n (AT p (TYPE=x))) * ESDS,AS/400,UNIX,PC | | | | (FMT='ff.') (SEQ=dd) (ISN=n) * ADABAS _______| | | | | (EXCL) (CIPHER=s) * ADABAS | | | | | (FMT=) (WHERE=) (UPD=) (SORT=) * DB2 |(STOPAFT=n)| | | | (NULLS) (VLEN) (PFX) (CHAR) * DB2 | | | | | (OPEN=RWD/NORWD) (LABEL=NO) * Tape | (TIMES=n)| | | | (CLOSE=UNLD/RWD/NORWD) * Tape | | | | | (CLOSE=NOFLUSH/LEAVE) * VSE ** Card/Dkt | | | | | (DEV=device) * Disk/Tape|______ | | | | (SYS=n) * VTOC/Tape | | | | | (TAB=n)(EOL=CRLF/LF/CR/NO/'str') * AS/400,UNIX,PC | | | | | (FILL=x) * AS/400,UNIX,PC | | | |_________|_____________________________________________________| | | | | | | | | UPDATE | fname (#nnn) n AT p1 | | | | | #nnn (FROM= p1 (,p2) ) | | | (NOW) | INSERT | fn.ft.fm 'string' | | | | | | | | | DELETE | * DEL is for KSDS/DL1/DB2 only. | | | THEN |_________|______________________________________________|__ | | | | fname/LOG/PRINT/PUNCH/TAPEnn/fn.ft.fm/#nnn/... | | | | | ../stdout/fileid/DUMMY/JECL/START/STOP/SUSP | | | ELSE | | | | | | | ( n AT p1 ) | | | | | (FROM=p1 (,p2) ) (LRECL=n/V/U) (WTO=YES) | | | | | ( 'string') |_ | | | | | | | | | (BLKSIZE=n) (RECFM=F/V/U/FB/VB/V2) * Tape/Disk | | | | | (FILL=x) (NEWBLK=YES) * Tape/Disk | | | | | (ISAM) (KEYLEN=n) * ISAM | | | | | (CYLOFL=n) (MSTIND=YES) * ISAM | | | | | (KEYPOS=p) * Blocked ISAM | | | | | (KEYFROM=p) * Unblked ISAM | | | | (WRITE) | (VSAM/KSDS/ESDS/RRDS) * VSAM ____| | | | | (REUSE) (PASS=string) * VSAM | | | | | (TYPE=N/C/H/M/MP/B/D/DX/S) * PRINT/LOG|(STOPAFT=n)| | | | ('literal') (DUMPALL) (DUMPENC) * PRINT/LOG| | | | | (PAGEDEPTH=n) (DATAWIDTH=n) * PRINT | | | | | (REPLY=n AT p)) * LOG/CP | (TIMES=n)| | | | (APPEND) (TRUNC/NOTRUNC) * CMS |____ | | | | (CLEAR) * CMS LOG | | | | | (OPEN=RWD/NORWD) (LABEL=NO) * Tape | | | | | (CLOSE=RWD/NORWD/UNLD) (LTM=YES) * Tape | | | | | (DEV=device/TAPE) * Disk/Tape | | | | | (SYS=n) * VTOC/Tape | | | | | (FAIL=NOCLOSE) * VSE ** Tape/Disk | | | | | (EOL=CRLF/LF/CR/NO/'str') * AS/400,UNIX,PC| | | |_________|___________________________________________________| | | | | | | | | DB2 | (SQL=) Full SQL statement/n at p (SSN=) | | | |_________|___________________________________________________| | | | | | | | | | Any | dbname | ( SEG=segname/p string ) | | | | DL1/IMS | | ( SEARCH=string/p op n AT p ) | | | | | (#nnn) |_____________________________________| | | | Function| | | | | | Code | DL1 | (SSA=string/p) | | |________|_________|_____________|_____________________________________|______| *** __________________________________________________________________________ | |Param or | SELCOPY Rel 2.0x Table 3. | |Op Word |Op Word |Parameters (See: Notes on Control Card Summary) | |________|_________|__________________________________________________________| | | | | | | | | | | ADD | | TO | | | | | |_________| |____| | (INTO n AT p5) | | | | | | | | ( p5,p6 ) | | | | SUB | n |FROM| n | | | | |_________|n (AT p1)|____|n (AT p1)| (TYPE=(B/P) | | | | | p1,p2 | | p1,p2 | - | | | | MULT | | | | | | | | | | BY | | (REM n AT p7) * REM only | | | | DIV | | | | ( p7,p8 ) * on DIV. | | | |_________|_________|____|_________|____________________________| | | | | | | | | CALL | name ( p1 p2 p3 ...p16 ) (SIZE=n) (ENTRY=n) | | | | | (ENTRYEOJ=n) | | | (NOW) |_________|___________________________________________________| | | | | | | | | | n AT p1 | (STOPAFT=n) | | THEN | COMPRESS| TO=p2 | | | | | FR p1 (,p2) * Default len is LRECL.| (TIMES=n) | | |_________|___________________________________________|_____ | | ELSE | | | | | | | | 'string in quotes' | (REPLY = n AT p3 ) * LOG/CP| | | | LOG |____________________| ( INTO p3 (,p4)) * only.| | | | CP | n AT p1 | | | | | SYSTEM | FROM= p1,p2 | | | | | STACK | p1 LEN n | (LIFO/FIFO) * STACK | | | | | 'string' | * only. | | | |_________|____________________|____________________________| | | | | | | | | | | CVCH | | | * Redundant | | | | CVHC | | | n AT p3 * destn | | | | CVAE | FR | | p3 (,p4) * length | | | | CVEA | FROM p1 (,p2) | | * ignored| | | |_________| POS n AT p2 | |_________________________| | | | | P | | | | | | CVBP | | | | | | | CVCB | | | n AT p3 | | | | CVCF |________________| TO | p3,p4 * | | | | CVCP | | INTO | * Mandatory | | | | CVPB | | |_____________* destn | | | |_________| n AT p1 | | * length. | | | | | FR | | * | | | | CVBC | | | p3 FORMAT=string | | | | CVFC | | | n AT p3 | | | | CVPC | | | p3,p4 | | | |_________|________________|______|_________________________| | | | | | | | | | | CVDATE | NOW | TO | DATECB | | | |_________|________________|______|_________________________| | | | | | | | | DO | userlab * Also see RETURN. | | | |_________|___________________________________________| | | | | | (STOPAFT=n) | | | EXIT | name (SIZE=n) (ENTRY=n) | | | |_________|___________________________________________| | | | | | (TIMES=n) | | | | n AT p1 | | | | EXPAND | TO=p2 | | | | | FR p1 (,p2) * Default len is LRECL.| | | |_________|___________________________________________|___ | | | | | | | | | EOM | | | | | EOMEMB * For DIRDATA inp. | | | | FLAG | | | | | | EODISK * For CMS DIRDATA only.| | | | | EOD | | | |_________|_______________________________________________|__ | | | | | | | | GENERATE| n AT p (BASE=string) RANGE=low,high/string | | | | | TYPE=B/Z/C/(P)| | | |_________|__________________________________________________| | | | | | | | | | GET * 1st control stmt. | | | | GOTO | EOJ * Force immed End Of Job. | | | | | CANCEL * EOJ, but indic error. | | | | | userlab * Any user defined label. | | |________|_________|__________________________________________________|_______| *** __________________________________________________________________________ | |Param or | SELCOPY Rel 2.0x Table 4. | |Op Word |Op Word |Parameters (See: Notes on Control Card Summary) | |________|_________|__________________________________________________________| | | | | | | | | * p may be any expression resolving to a | | | | LRECL = | p * position in rec/workarea, e.g. 2002 / | | | | | * L+6 / L-42 / @+22-EQUNAME / @FRED-6+@BILL | | | | @ = |_____________________________________________________| | | | | | | | | @user = | n AT p ( TYPE=B/C/P ) * TYPE=P is default. | | | |_________|_____________________________________________________| | | | | | | | | | TAGBEG / TAGEND | | | | | TAGNEXT / TAGPREV |(STOPAFT=n)| | | | TAGDEL / TAGINS / TAGREP | | | | MARC | p1 (,p2) * p1 --> mcb | | | | | TAGKEY n AT p3 * p2 --> rec | | | | | p3,p4 | (TIMES=n)| | | | TAGKGE string | | | |_________|______________________________________________|__ | | | | | | | | | | | POS | p1 (,p2) | | literal | | | | | P | p1 LEN n | ( = ) | (ASC/EBC) | | | | | | | (MOD) |______________| | | | |_________|_________________| | | | | | | | | AND | n AT p3 | | | | (NOW) | | (POS) p1 (,p2) | OR | | | | | | MOD | (P ) p1 LEN n | XOR | POS p3 (,p4) | | | | | | n AT p1 | | P p3 LEN n | | | | |_________|_________________|_______|______________| | | | THEN | | | |(FILL=x)| | | | | FR | |( PAD )| | | | | FROM p1 (,p2)| | | | | | | POS n AT p | p3 (,p4) | | | | ELSE | | P | TO | | | | | MOVE | p1, p2 | INTO | | | | | | 'literal' | n AT p3 | | | | | | | FR | | | | | | n (AT p1) | | | | | | | FR | | | | | |_________|_______________|________________________|________| | | | | | | | | RETCODE | n | | | |_________|______________________________________________|(STOPAFT=n)| | | | | | | | RETURN | * No parameters. | | | |_________|______________________________________________| (TIMES=n)| | | | | | | | SLEEP | n (SECS/MINS/HOURS) | | | |_________|______________________________________________| | | | | | | | | SPACE | n | | | | LINE | | | | |_________|______________________________________________|__ | | | | | | | | | | | p1,p2 | 'lit1' 'lit2' | | | | | | |__________________| | | | | | n AT p1 | | p4 (,p5)) | | | | | FR | UPPER/LOWER | | | | | |______________| ASCII/EBCDIC |(TO | | | | TRAN | | PRINT | | | | | | FROM |__________________|(INTO | | | | | p1,p2 | | | | | | | | 256 AT p3 | n4 AT p4) | | | | | n at p1 | TAB= | FR) | | | | | POS | p3 (,p3+255) | | | | |_________|______________|__________________|_______________| | | | | | | | | | | n AT p1 | | | | | UPPER | | (TO p3) | | | | LOWER | | | | | | | p1,p2 | | | | |_________|_________________________________|______________|_ | | | | | | | | | | fileid | 'yyyy/mm/dd hh.mm.ss' | | | | UTIME | p1,p2 | FTIME= p3,p4 | | | | | n at p1 | n at p3 | | |________|_________|______________|___________________________________|_______| *** __________________________________________________________________________ | |Param or | SELCOPY Rel 2.0x Table 5. | |Op Word |Op Word |Parameters (See: Notes on Control Card Summary) | |________|_________|__________________________________________________________| | | | | | | | | * Transfer Variable - CMS, VSE and MVS/TSO. | | | | | | | | | | FETCH 'varname' | | | | | GET n AT p1 INTO n AT p3 |(STOPAFT=n)| | (NOW) | | SET p1 p2 p3 p4 (NOSUBS) | | | | |______________________________________________|______ | | | | | | | | XV | NEXT n AT p1 INTO n AT p3 * CMS and TSO. | | | THEN | | p1 p2 p3 p4 | | | | |_____________________________________________________| | | | | 'varname' | | | | | DROP n AT p1 (NOSUBS) * CMS REXX only.| | | ELSE | | p1 p2 | | | | |_____________________________________________________| | | | | ARG | | | | | SOURCE INTO n AT p1 * CMS REXX only.| | | | | VERSION p1 p2 | | |________|_________|_____________________________________________________|____| *** __________________________________________________________________________ | POS | SELCOPY Rel 2.0x Table 6. | | Keyword | Description (See: Notes on Control Card Summary) | |_________|___________________________________________________________________| | | | Additional POS keywords allow reference to data outside the input or work | | area, or to special positions within it. | | POS keywords can be arguments to: POS, FROM, TO, INTO, and AT parameters. | | | | Numeric displacements on these keywords allow reference to keyword+n or | | keyword-n as required, | |_____________________________________________________________________________| | | | | @ | The @ pointer, set by assignment or by a Range Test. | | @user | A user defined @ pointer. | | ANY | Anywhere within logical record, from POS 1 to POS LRECL. | | CBLNAME | Points to the start of the currently loaded CBLNAME module. | | COMREG | VSE: The COMREG system control block. (synonym COMRG.) | | DATE | A table of today's dates in various formats, built by SELCOPY. | | DIFF | Points to first difference in string1 after a string compare. | | DSN | MVS: The 44-byte Data Set Name of the last file processed. | | | CMS: The 18-byte Fileid, Fn Ft Fm of last file processed. | | FHDR | The 128-byte File Header Record of the last RECFM=MFV input file. | | FNAME | The 8-byte File Name of the last file processed. | | FSIZE | The 4-byte binary File Size at OPEN time of last file, if known. | | | e.g. VSAM and CMS files. | | FT | The start of SELCOPY's File Table for the file last accessed. | | HEAD | The start of SELCOPY's Heading. POS HEAD-1 --> ASA char. | | LRECL | Last position in current logical rec, assuming POS 1 is 1st. | | L | Synonym for LRECL. | | PARM | The PARM data passed on the EXEC invoking SELCOPY. | | PCB | IMS/DL1: The PCB for the last data base used. | | PGNO | Synonym for UXPGNO, Current Page Number. | | RBA | Relative Byte Address within the file of the last record read. | | RETSYS | Return Code from last SYSTEM command. 4-byte Binary. | | RETCODE | Highest Return Code last set by SELCOPY. 4-byte Binary. | | RETCD | Synonym for RETCODE. | | RETVSAM | Return Code from last VSAM operation. 4-byte Binary. | | RETXV | Return Code from last XV command. 4-byte Binary. | | RPL | SELCOPY Request Parameter List for VSAM, DB2, IMS, DL1 & ADABAS. | | SEG | IMS/DL1: 8-byte Segment Name of last data base used. | | STATUS | IMS/DL1: 2-byte Status Code following last dbase operation. | | SQLCA | DB2: SQL Communication Area. | | SQLDA | DB2: SQL Descriptor Area. | | SQLMA | DB2: SELCOPY Message Area. | | UPSI | VSE: The UPSI byte in COMREG. | | UXADIFF | Absolute addr of where POS DIFF is pointing.4-byte Binary. | | UXATPTR | Absolute addr of where POS @ is pointing. 4-byte Binary. | | UXDW | Current Data Width value. 4-byte Binary. | | UXINCNT | Input Record Count of Prime input file. 4-byte Binary. | | UXLINE | Line count in current page of PRINT. 4-byte Binary. | | UXLINEREM Lines remaining in current page of PRINT. 4-byte Binary. | | UXLRECL | Length of current input record. 4-byte Binary. | | UXPD | Current Page Depth value. 4-byte Binary. | | UXPGNO | SELCOPY's internal Page Number accumulator. 4-byte Packed Dec. | | UXPW | Current Page Width value. 4-byte Binary. | | UXREPLYL| Length of last LOG REPLY input. 4-byte Binary. | | VOLID | 11 byte volume label of the disk containing the last input fileid.| |_________|___________________________________________________________________| _________________________________________________________ | | | Notes on Control Card Summary | |_________________________________________________________| ( ) Words or parameters enclosed in brackets are optional and may be omitted on SELCOPY control cards. The brackets must be omitted. = , Equal signs and commas in SELCOPY control cards are for the user's readability only, and may be kept or replaced with blanks as required. Multiple occurrences are acceptable. e.g. ==write== abcfil,,,,from==,,==1,,,,,,,,,= The only exception to this rule is where a comma is used to separate the start and end positions of a p1, p2 range or field definition, where the p2 expression starts with a positive or negative displacement. e.g. pos 1, +10-@+1 / Indicates a choice from a list of parameters separated by '/'. You may choose ONE only. If one of the parameters is enclosed in brackets, that parameter is the default if none are used. fname represents a file name. This may be a user chosen name for an ordinary file, or one of the SELCOPY keywords representing a special file, or special action. They are: CARD DUMMY JECL LOG PRINT PUNCH START STOP SUSP and TAPEnn. fn.ft.fm is a VM/CMS file name in native form. fileid is a full AS/400, UNIX or PC file name in native form. #nnn is a DL1 or ADABAS file identifier where nnn is numeric. The hash sign is optional. string is character data of any length. Only needs to be enclosed in quotes if it has embedded blanks, commas, asterisks or quotes. 'literal' represents a string to be moved, printed or written to a file. It must always be enclosed in quotes. n represents a number of bytes or a record number. An expression is allowed, provided it evaluates to a simple number. The @ pointer, user @ pointers, or the Position Keyword, LRECL, may also be included. e.g. 22+@+45-7+EQUATEDNAME-6+EQUNAM2+17+@FRED-@A+@BB+1+LRECL would be valid, provided the equated names do not involve special Position Keywords. The maximum value varies according to where it is used. Please refer to the Parameter Description for details. p p1 p2 etc represent a position within the input or work area. The theoretical maximum value is 2,147,483,647, but the size of the work area, defined by WORKLEN=n is the practical limit. Certain keywords have a special interpretation, e.g. @ ANY DATE L PCB and UXLRECL. Numeric displacements, including pointer variables, may be used. e.g. AT 2+4+@A-@B+20 POS=@+92-47+6 FROM=L-23+9-EQUNAME+7 p1,p2 or p1 (,p2) represents a range where p1 is the start of the range and p2 is the upper position (last). The syntax (,p2) indicates that a range is optional. The position p2 must always be greater than or equal to p1, and the keyword ANY may not be used because ANY is defined as the range starting at POS 1 up to POS LRECL, where LRECL is the length of the current input record. name is that of a link-edited Phase for VSE, Load module for MVS or CMS, Shared Object Module for UNIX, and Dynamic Link Library for PC. x represents a single byte which may be supplied as character or hex. userlab is a user chosen name to be used with GOTO and DO (PERFORM). Labels may be any length which fits on a card, and may contain any character other than SELCOPY delimiters. They are underlined when the control statements are printed. Certain words, such as PRINT, PR, EOJ and QUIT, may not be used as labels because they are treated in preference as Operation Words. )) may be any combination of non-alpha non-numeric characters, used for VSE to define a non-standard EOF char sequence for SYSIPT. device may be any of the device codes listed under the DEV parameter. op may be any of the SELCOPY defined Comparison Operators for use within an IF-type statement, or a DL1 SEARCH argument. --- End --- *** _______________________________________________________ | | | | | Operation Words, Parameters | | and Keywords | | | |_______________________________________________________| See also: Section CONTROL CARD SUMMARY. All SELCOPY Parameters and Operation Words are listed below in alphabetical order. Sometimes it is difficult to find the parameter, keyword, argument or comparison operator that is required. Some are the synonym form of something else, which starts with a different letter. For example the LOW parameter is described under the heading of its synonym, GE. Under such difficulty the index may provide assistance. It should have an entry for each synonym, as well as an entry for anything else of interest. Each parameter is followed by a description of its action in each situation where it is used plus any necessary information concerning the argument. Some will have a reference to a more elaborate discussion later in the manual on the same subject. e.g. IMS and DL1. Reference to one particular parameter description may not necessarily give you every other possible parameter that may be used on the same SELCOPY statement. Operation Words permitted in SELCOPY control statements are detailed below, merged in with the parameters in alphabetical order. Examples of Operation Words are: OPTION REPORT NOPRINT EOF EQU <------------- (This is an important one) READ CAT OPEN CLOSE CKPT WRITE UPD INS DEL DL1func DB2 SQL=sqlstmt IF AND OR THEN ELSE THENIF ELSEIF DO RET EOJ CANCEL END All Operation Words are optional with the exception that there must be at least one causing input of a file (or an OPTION statement defining a WORKLEN), and at least one causing output to a file, where PRINT, LOG or DUMMY are sufficient to satisfy the requirement for an output file. ! (Default separator character) *-***-* See also: SEP in this section. Separator Character in section FURTHER INFORMATION * (Comment) *-***-* READ FILE=ABC * Read a record from ABC PRINT STOP=22 * Print the 1st 22 of them. ** Update eyecatcher ** IF POS 1 = '*!*' * Asterisks must be in quotes. T P 2 = '*' * Set to *** An asterisk (X'5C' EBCDIC, X'2A' ASCII) in position 1, or in any position which is preceded by a blank and is not enclosed in quotes, defines the start of comment data. The sequence field at the end of the statement defines the end of the comment. If the comment ends with the continuation character '\' then the subsequent control statement is read as comment data. Comment data is ignored by SELCOPY for syntax purposes. *< (Comment Ignoring Separator) *-***-* *< IF POS 22 = 'ABC' !T POS 13 = 'DEF' *< IF @A = 1 !AND @B