MVS TOOLS AND TRICKS OF THE TRADE December 1989 Sam Golob MVS Systems Programmer sbgolob@cbttape.org CONVERT CLIST LIBRARIES FROM VB TO FB AND VICE-VERSA I must begin this month's column with an announcement that I did not want to make. As of this writing, it appears that the Connecticut Bank and Trust Company data center, where Arnold Casinghino has produced his famous MVS Mods tapes, is about to close, due to a merger. Arnie has, of course, expressed his desire to continue making the tapes from a new position. However in the interim, because of the unbelievable usefulness of these tapes to the systems programming field, I will accept new contributions to the tape at NEWSWEEK until Arnie gets resettled. I am not in a position to distribute large quantities of tapes. However, all new versions of the tapes will be obtainable from Mike Loos (of Deluxe Check Printers in Minnesota) under the auspices of NaSPA. Since the tapes contain public-domain material, installations are encouraged to make copies of the tapes for themselves and others. A program that is convenient for this purpose, can be found on the CBT tape, file 229. New contributors (or file updaters), please inquire from me at sbgolob@cbttape.org * * * * * * * * * * * * * * * * * * * * * * This month, I want to discuss an issue that our honored main supplier has largely ignored for twenty years. It concerns the two permissible formats for TSO clists, and how to convert clist libraries conveniently from one format into the other. The conversion should be done in such a way, that the execution of the individual clists in the libraries remains undamaged and unchanged. We have included the entire source for a program, CVTCLIST, in this article. CVTCLIST converts ENTIRE CLIST LIBRARIES from one format into the other, either way. This CVTCLIST program is very old. A version of it has resided on file 187 of the CBT Mods tape for many years. The old program has been useful for conversions (especially in the FB-to-VB direction) but it contained many bugs. I have finally sat down, at the request of my friend Lovell Ramsden of Montefiore Hospital in New York, and made a serious attempt to fix all the bugs. The topic itself is not hard to explain. IBM has made it possible to have command lists under TSO that are in either of two data formats: One format is the "short" record form of fixed blocked 80-byte card-image records, with sequence numbers in columns 73-80. These records have the same overall layout as assembler source statements, with the exception that column 72 is perfectly acceptable to contain any valid clist data. The other format is the "long" record form of variable-blocked records. There are a few necessary considerations to understand these. Maximum LRECL is equal to 255. Not all of this is for data. We must subtract four bytes for the four-byte "Record Descriptor Word", the "RDW", at the beginning. The RDW tells us how long our current record (which is variable) is. The first halfword of the RDW contains the length of the current record in binary, and the second halfword normally contains hexzeros. We must also subtract eight more bytes from the 251 that are left, to account for the sequence numbers in columns 1-8. That leaves 243 bytes for valid clist data, in a single line. Thus the VB-type clists can have LONG LINES. Of course, it makes sense that the VB records must have the sequence numbers at the beginning. If those were in any other place in the record, they would force every record to be LONG. That would defeat the purpose of having variable-length records in the first place, which is to keep the individual records as short as possible to save space. Blanks should always be truncated from the end of a variable length record, (but in practice, this does not always occur). That's almost all the info we have to know. There's just a little bit more, to complete our picture of the issue we're dealing with. We must discuss the details of what is involved in converting a clist that is in one form, to be in the other form. Let's first consider an FB (fixed-blocked 80-byte records) clist. What must we do, to convert it to VB (variable blocked, LRECL=255) format? The first 72 bytes of each FB-80 clist record must be examined. A variable length record must be formatted to contain its data. First, an RDW of four bytes is reserved in the output buffer. Then, the eight-byte sequence number is plugged into the beginning of the data portion of the VB record. Finally, the data bytes of the FB clist record are copied to the VB buffer, starting in the ninth column, after the sequence number. The record will end when the last non-blank character of the line is found. Then, since the length is now known, that value in binary, is placed in the first halfword of the RDW. So much for an individual record. We keep writing out variable records like these, until a complete block of data is accumulated in the buffer. We forgot to mention (in keeping it simple) that a four-byte "Block Descriptor Word", or "BDW" must precede the entire variable block. The four-byte space for the BDW had to be reserved at the beginning of the output buffer. When a block has been filled, and the total length of all data in the block is now known, that value, in binary, is stored in the first halfword of the BDW. (For non-spanned VB records, the second halfword contains hexzeros.) Then the block is written out to disk. Thus, FB to VB conversion consists merely of writing all the nonblank clist data of ONE card-image, into ONE variable-length record, formatted correctly in a VB block. That's a rather simple and mechanical process. Reformatting the long VB records into several "continued" FB records is even simpler. The general idea is to split a long record at 71 characters, put a dash (a continuation character) in column 72, and continue the record at the beginning of the next line. However, if the data in a record is exactly 72 characters long, that line should not be split. This is because in an FB-format clist, all of the first 72 characters in the record are valid to contain executable data. Sequence numbers are plugged into columns 73-80 of each newly-created card-image, and the conversion is complete. To my knowledge, IBM has never supplied a fast-acting convenient method of converting entire CLIST libraries both ways. In response to necessity, THEY HAVE supplied a conversion clist called ICQSMC00 with TSO/E, which converts entire libraries. But ICQSMC00 has two big drawbacks. Number one, it is slow, and its action is very complicated, especially when dealing with big libraries. Number two, it only converts clists from 80-byte fixed format to the variable format, but it does not go the other way. The reason why IBM provided the ICQSMC00 clist is that none of the releases of SMP before SMP/E Release 5, could be used to distribute variable-blocked libraries. In order for IBM to distribute clists, the company had to package them in card-image fixed blocked format, and it was up to the customer to convert the individual clists to variable. Without a conversion aid such as our program, or IBM's clist ICQSMC00, the programmer had to use the ISPF 3.3 copy utility, or some other copy utility that would convert data from fixed to variable form. After fixed-to-variable record format conversion of each member, there remained the problem of having the sequence numbers in the wrong place. The programmer had to edit each member individually, shift all the data to the right by eight bytes, get rid of old sequence numbers (now in columns 81-88), and renumber the member. This is a very tedious process for large numbers of large libraries. As far as the advantages of going the other way, VB-to-FB, an installation that had been using ALL VB-FORMAT libraries, found itself locked into that format, with almost no possibility of escape. Any possible conversion to the short-record fixed format, would have to be accompanied by extensive testing of each individual clist, to make sure that it still would execute correctly. It was highly possible that the folding of long records would introduce numerous execution errors into the clists. Now that we've fixed the CVTCLIST conversion program, these problems (hopefully) should become a thing of the past. I'm including the entire text of the corrected CVTCLIST program in this article, and I'm contributing it to the NaSPA V.I.P. tape and to the CBT Mods tape. Installations can also download it from NASCOM when they download this article. Hope we've done something useful this month. Good luck in all your work and efforts. * * * * * * * * * * * * * * * * * * * * * * FIGURE ONE. The CVTCLIST Conversion Program. CNVT TITLE 'CLIST LIBRARY CONVERSION PROGRAM: FB-VB, VB-FB' *SBG 00000100 ****************************************************************** *SBG 00000200 * * *SBG 00000300 * THIS IS AN ASSEMBLER PROGRAM TO CONVERT ENTIRE CLIST * *SBG 00000400 * LIBRARIES FROM THE 80 BYTE - FIXED BLOCKED FORMAT, WITH * *SBG 00000500 * SEQUENCE NUMBERS IN COLUMNS 73-80, TO THE OTHER CLIST * *SBG 00000600 * FORMAT: 255-BYTE - VARIABLE BLOCKED RECORDS, WITH THE * *SBG 00000700 * SEQUENCE NUMBERS IN COLUMNS 1-8 OF THE DATA PORTION OF * *SBG 00000800 * EACH RECORD, AND VICE-VERSA. THE PROGRAM GOES BOTH WAYS. * *SBG 00000900 * * *SBG 00001000 * THE SYSUT1 DATASET IS INPUT, AND THE SYSUT2 DATASET IS * *SBG 00001100 * OUTPUT. THE PROGRAM EXAMINES THE DCB INFORMATION FROM * *SBG 00001200 * EACH DDNAME, AND FIGURES OUT WHICH WAY THE CONVERSION * *SBG 00001300 * SHOULD PROCEED. ALL MEMBERS ARE CONVERTED IN ONE RUN * *SBG 00001400 * OF THE PROGRAM. RESULTS ARE REPORTED IN THE SYSPRINT DD. * *SBG 00001500 * * *SBG 00001600 * THE PROGRAM WAS DESIGNED FOR THE CASE IN WHICH THE SYSUT2 * *SBG 00001700 * (OR TARGET) LIBRARY DOES NOT HAVE ANY MEMBERS TO BEGIN * *SBG 00001800 * WITH. * *SBG 00001900 * * *SBG 00002000 * THIS PROGRAM WAS SUBMITTED TO THE CBT MVS MODS TAPE, * *SBG 00002100 * FILE 187, BY BOB COLLINS OF THE FIRST NATIONAL BANK OF * *SBG 00002200 * CHICAGO. HE OBTAINED IT FROM ANTIQUITY, AND GOT IT TO * *SBG 00002300 * WORK UNDER MVS. * *SBG 00002400 * * *SBG 00002500 * THE VB TO FB FUNCTION OF THE PROGRAM (SYSUT1 DD DATASET * *SBG 00002600 * IS OF THE VB TYPE AND THE SYSUT2 DD DATASET IS FB) HAD * *SBG 00002700 * MANY BUGS, IN SPLITTING OF THE LONG RECORDS. SOME NEWLY * *SBG 00002800 * CREATED FB CLISTS DID NOT BEHAVE EXACTLY AS DID THE OLD * *SBG 00002900 * VB VERSION FROM WHICH THEY WERE MADE. ALSO, THERE WAS A * *SBG 00003000 * RUNAWAY CONDITION WHICH COULD RESULT FROM HAVING LONG * *SBG 00003100 * STRINGS IN THE VB FORMAT THAT HAD NO IMBEDDED BLANKS. * *SBG 00003200 * * *SBG 00003300 * I HAVE ATTEMPTED TO FIX THESE BUGS. I CANNOT GUARANTEE * *SBG 00003400 * THAT EVERY CLIST IN THE WORLD WILL CONVERT FLAWLESSLY * *SBG 00003500 * UNDER THIS PROGRAM, BUT ITS OPERATION HAS BEEN IMPROVED * *SBG 00003600 * BY ORDERS OF MAGNITUDE THROUGH THESE FIXES, HOPEFULLY. * *SBG 00003700 * * *SBG 00003800 * I TRIED TO AVOID MAKING ASSUMPTIONS ABOUT CONTINUATION * *SBG 00003900 * CHARACTERS, IN ANY WAY. THIS GOT THE ORIGINAL AUTHOR * *SBG 00004000 * INTO HIS ORIGINAL TROUBLE. * *SBG 00004100 * * *SBG 00004200 * THERE IS ONE PERVERSE CASE THAT I KNOW ABOUT. IF A VB * *SBG 00004300 * CLIST HAS RECORDS WITH TRAILING BLANKS AFTER THE LAST * *SBG 00004400 * NON-BLANK CHARACTER, AND THE TRAILING BLANKS EXTEND PAST * *SBG 00004500 * DATA COLUMN 72 (REALLY COLUMN 80), THEN THE PROGRAM WILL * *SBG 00004600 * SPLIT THE RECORD ERRONEOUSLY. * *SBG 00004700 * * *SBG 00004900 * THE BEST WAY TO TEST THIS PROGRAM IS TO CONVERT A LIBRARY * *SBG 00005000 * FB-TO-VB-TO-FB, (OR VB-TO-FB-TO-VB), AND ENSURE THAT THE * *SBG 00005100 * FINAL LIBRARY COMPARES IDENTICAL TO THE STARTING LIBRARY. * *SBG 00005200 * * *SBG 00005300 * MY HOPE IS THAT THIS PROGRAM WILL ELIMINATE THE GREAT * *SBG 00005400 * LABOR AND UNCERTAINTY THAT IS INVOLVED IN ANY CLIST * *SBG 00005500 * FORMAT CONVERSIONS, NO MATTER WHICH KIND THEY ARE. * *SBG 00005600 * * *SBG 00005700 * * *SBG 00005800 * S.GOLOB - 10/07/89 * *SBG 00005900 * P.O. Box 423 * *SBG 00006000 * Howell, NJ 07731-0423 * *SBG 00006100 * * *SBG 00006200 * * *SBG 00006300 ****************************************************************** *SBG 00006400 * DATA SET CBT1018 AT LEVEL 001 AS OF 11/19/79 00006500 EJECT , *SBG 00006600 *FUNCTION CONVERT CLISTS FROM 255 LRECL VB TO 80 LRECL FB 00006700 * OR VICE-VERSA 00006800 *I/O SYSUT1 INPUT CLIST 00006900 * SYSUT2 OUTPUT CLIST 00007000 * SYSPRINT LISTING 00007100 *NOTE VB CLISTS HAVE SEQUENCE NUMBERS IN POS 1-8 00007200 * FB IN 73-80 00007300 * RETURN CODE 00007400 * 8 JOB TERMINATED BEFORE START OF COPY 00007500 * 12 JOB TERMINATED AFTER START OF COPY 00007600 * 00007700 EJECT *SBG 00007800 MACRO 00007900 SYMBR 00008000 ** EQUATES FOR SYMBOLIC REG USAGE 00008100 R0 EQU 0 00008200 R1 EQU 1 00008300 R2 EQU 2 00008400 R3 EQU 3 00008500 R4 EQU 4 00008600 R5 EQU 5 00008700 R6 EQU 6 00008800 R7 EQU 7 00008900 R8 EQU 8 00009000 R9 EQU 9 00009100 R10 EQU 10 00009200 R11 EQU 11 00009300 R12 EQU 12 00009400 R13 EQU 13 00009500 R14 EQU 14 00009600 R15 EQU 15 00009700 RA EQU 10 00009800 RB EQU 11 00009900 RD EQU 13 00010000 RE EQU 14 00010100 RF EQU 15 00010200 MEND 00010300 MACRO 00010400 &NAME SAVEX &AREA,&BASE,&VERSION,&INIT,&TESTRAN 00010500 .* DPHQ SYSTEM/360 - OPERATING SYSTEM SSS 00010600 .* V4M0 DECEMBER 2, 1966 F. W. VOSS 00010700 LCLA &A1 00010800 LCLC &TEST 00010900 &TEST SETC '&AREA'(1,5) 00011000 AIF ('&AREA' NE '').GD1 00011100 MNOTE 12,'SAVE AREA NAME MISSING - NO GEN' 00011200 MEXIT 00011300 .GD1 ANOP 00011400 &A1 SETA &BASE 00011500 USING *,15 00011600 &NAME B 22(0,15) BRANCH AROUND ID 00011700 DC FL1'18' 00011800 AIF ('&NAME' NE '').GD2 00011900 DC CL9'&SYSECT' IDENTIFIER 00012000 AGO .CT1 00012100 .GD2 DC CL9'&NAME' IDENTIFIER 00012200 .CT1 DC CL8'&VERSION' VERSION 00012300 STM 14,12,12(13) SAVE REGISTERS 00012400 ST 13,&AREA+4 CHAIN FORWARD 00012500 CNOP 0,4 00012600 AIF (&A1 GT 2).MV2 00012700 AIF (&A1 EQ 2).GD3 00012800 AGO .CT5 00012900 .MV2 MNOTE 'INVALID BASE REQUEST - USING 2' 00013000 AGO .GD3 00013100 .CT5 ANOP 00013200 BAL 13,&AREA+72 SETUP SAVE AREA POINTER AND BASE 00013300 DROP 15 00013400 USING *,13 ESTABLISH ADDRESSABILITY 00013500 &AREA DC 18F'0' SAVE AREA 00013600 L 15,&AREA+4 00013700 ST 13,8(0,15) CHAIN BACK 00013800 AGO .CT7 00013900 .GD3 ANOP 00014000 BAL 13,&AREA+76 SETUP SAVE AREA POINTER AND BASE 00014100 DROP 15 00014200 USING *,13,12 ESTABLISH ADDRESSABILITY 00014300 &AREA DC 18F'0' SAVE AREA 00014400 DC AL4(&AREA+4096) 00014500 L 15,&AREA+4 00014600 ST 13,8(0,15) CHAIN BACK 00014700 L 12,&AREA+72 ESTABLISH 2ND BASE 00014800 .CT7 ANOP 00014900 AIF ('&INIT' EQ '').CT9 00015000 .CT9 ANOP 00015100 AIF ('&TESTRAN' EQ '').CT6 00015200 AIF ('&TESTRAN' EQ 'TEST').CT8 00015300 MNOTE 'INVALID TESTRAN EDIT REQUEST' 00015400 AGO .CT6 00015500 .CT8 ANOP 00015600 * TESTRAN SPIE MACRO 00015700 SPIE &TEST.EXT,((1,15)) 00015800 B &TEST.ABE BRANCH AROUND TESTRAN DUMP 00015900 SPACE 2 00016000 &TEST.EXT BALR 15,0 ESTABLISH ADDRESSABILITY FOR TESTRAN ABEND 00016100 DROP 13 00016200 USING *,15 00016300 MVC &TEST.PSW,4(1) MOVE OLD PSW FROM PIE 00016400 * TESTRAN ABEND MACRO 00016500 &TEST.ERR ABEND 4444,DUMP 00016600 &TEST.PSW DC XL8'0' OLD PROGRAM PSW ON PROGRAM INTERRUPT 00016700 DROP 15 00016800 USING &AREA,13 REESTABLISH CSECT ADDRESSABILITY 00016900 &TEST.ABE EQU * 00017000 .CT6 ANOP 00017100 SPACE 2 00017200 MEND 00017300 *FUNCTION CONVERT CLISTS FROM 255 LRECL VB TO 80 LRECL FB 00017400 * OR VICE-VERSA 00017500 *I/O SYSUT1 INPUT CLIST 00017600 * SYSUT2 OUTPUT CLIST 00017700 * SYSPRINT LISTING 00017800 *NOTE VB CLISTS HAVE SEQUENCE NUMBERS IN POS 1-8 00017900 * FB IN 73-80 00018000 * RETURN CODE 00018100 * 8 JOB TERMINATED BEFORE START OF COPY 00018200 * 12 JOB TERMINATED AFTER START OF COPY 00018300 * 00018400 * R11 RETURN 00018500 * R10 DCB TEMPLATE 00018600 * R7 OUTPUT POINTER 00018700 * R6 INPUT POINTER 00018800 * R5 LENGTH CODE 00018900 * R4 INPUT START OF BLOCK 00019000 * R3 OUTPUT START OF BLOCK 00019100 SYMBR 00019200 TEST20 EQU X'20' 00019300 EJECT 00019400 CNVCLIST CSECT 00019500 SAVEX SAVEAREA,1,COPYCLST 00019600 SPACE 00019700 OPEN (CLISTIN,(INPUT)) 00019800 SPACE 00019900 OPEN (CLISTOUT,(OUTPUT)) 00020000 SPACE 00020100 USING IHADCB,R10 00020200 LA R10,CLISTIN USE DCB NAMES FOR INPUT DCB 00020300 BAL R11,TESTVORF 00020400 BAL R11,GETMAIN GET CORE FOR INPUT BLOCK 00020500 LR R4,R1 SAVE INPUT BLOCK ADDRESS 00020600 LA R10,CLISTOUT USE DCB NAMESFOR OUTPUT DCB 00020700 BAL R11,TESTVORF 00020800 BAL R11,GETMAIN GETMAIN FOR OUTPUT BLOCK 00020900 LR R3,R1 SAVE OUTPUT BLOCK ADDRESS 00021000 TM SWITCH,X'80' IF 1 FILE IS F AND 1 V 00021100 BO SAVEOUT CONTINUE 00021200 MVC ERRORMSG,MSG3 00021300 MVC RC,=H'8' 00021400 B WRITERR 00021500 SPACE 2 00021600 TESTVORF EQU * 00021700 TM DCBRECFM,X'C0' CHECK FOR V OR F 00021800 BM CONTVF IF NOT V OR F ERROR 00021900 MVC ERRORMSG,MSG1 00022000 MVC RC,=H'08' 00022100 B WRITERR 00022200 CONTVF TM DCBRECFM,X'80' IF V 00022300 BZ EXITVORF EXIT 00022400 XI SWITCH,X'80' FIRST F TURNS ON-SECOND OFF 00022500 CLC DCBLRECL,=H'80' IF F AND LRECL NOT = 80 00022600 BE EXITVORF THEN ERROR 00022700 MVC ERRORMSG,MSG2 00022800 MVC RC,=H'8' 00022900 B WRITERR 00023000 EXITVORF BR R11 RETURN 00023100 SPACE 2 00023200 GETMAIN EQU * 00023300 LH R0,DCBBLKSI GET CORE F0R PROCESSING AN 00023400 GETMAIN R,LV=(0) INPUT BL0CK 00023500 SPACE 00023600 BR R11 00023700 SPACE 2 00023800 SAVEOUT EQU * SAVE DATA FOR MAINLINE 00023900 MVC OUTBLKSI,DCBBLKSI 00024000 LR R7,R3 INITIALIZE OUTPUT POINTER 00024100 TM DCBRECFM,X'80' IF OUTPUT IS V 00024200 BZ SAVEIN SAVE INPUT END OF BLOCK 00024300 OI SWITCH,TEST20 ELSE SET INPUT SWITCH TO V 00024400 LH R12,DCBBLKSI 00024500 LA R12,0(R12,R3) SAVE OUTPUT END OF FIXED BLOCK 00024600 ST R12,ENDF 00024700 LA R10,CLISTIN 00024800 B INITREAD 00024900 SPACE 00025000 SAVEIN LA R10,CLISTIN 00025100 LH R12,DCBBLKSI SAVE INPUT END OF FIXED BLOCK 00025200 LA R12,0(R12,R4) 00025300 ST R12,ENDF 00025400 LH R12,OUTBLKSI SAVE MAXIMUM END OF OUTPUT 00025500 LA R12,0(R12,R3) VARIABLE BLOCK 00025600 ST R12,ENDV 00025700 LA R7,4(R7) POINT PAST BLK COUNT FOR V 00025800 SPACE 2 00025900 INITREAD EQU * 00026000 CLOSE (CLISTIN) 00026100 MVI DCBRECFM,X'C0' SET INPUT RECFM TO U 00026200 MVI CLISTOUT+36,X'C0' SET OUTPUT RECFM TO U 00026300 OPEN (CLISTIN,(INPUT)) 00026400 READDIR EQU * 00026500 OI SWITCH,X'40' SET DIRECTORY READ ON 00026600 READ DECB1,SF,CLISTIN,DIRIN,256 00026700 CHECK DECB1 00026800 NOTE CLISTIN 00026900 XI DIRSW,X'FF' SINCE SAVETTR POINTS TO 00027000 CLI DIRSW,X'00' BEGINNING OF DIRECTORY, READ 00027100 BE READDIR TWICE AFTER FIRST READ. 00027200 SPACE 00027300 ST R1,SAVETTR SAVE POINTER TO DIRECTORY 00027400 LH R9,DIRIN 00027500 STH R9,DIRLEFT SAVE DIRECTORY LENGTH 00027600 LA R9,DIRIN+2 00027700 ST R9,NEXTMEM 00027800 SPACE 2 00027900 GETMEM EQU * GET BLOCK OF DATA 00028000 ZAP SEQCOUNT,=P'0' ZERO OUT SEQUENCE COUNT FOR MEM 00028100 L R8,NEXTMEM LOAD ADDRESS OF MEMBER NAME 00028200 CLC HIVALUE,0(R8) IF MEMBER NAM = HIVALUES 00028300 BE EOJ GO TO END OF JOB 00028400 NI 11(R8),X'1F' 00028500 MVC DIRLIST+11(63),11(R8) MOVE USER DATA TO DIRLIST 00028600 MVC NAME,0(R8) PUT NAME IN OUTPUT DIRECT LIST 00028700 SR R12,R12 CLEAR REGISTER 00028800 IC R12,11(R8) LOAD # OF HALFWORDS OF USERDATA 00028900 LA R12,12(R12,R12) DOUBLE AND ADD 12 00029000 LA R9,0(R12,R8) COMPUTENEXT MEMBER DIR ADDA 00029100 ST R9,NEXTMEM SAVE ADDRESS OF NEXT MEMBER 00029200 LH R9,DIRLEFT COMPUTE BYTES LEFT IN 00029300 SR R9,R12 DIRECTORY 00029400 STH R9,DIRLEFT 00029500 NI 11(R8),X'00' CLEAR C OF TTRC 00029600 LA R8,8(R8) LOAD ADDRESS OF TTR 00029700 NI SWITCH,X'BF' TURN DIRECTORY READ SW OFF 00029800 POINT CLISTIN,(8) 00029900 SPACE 00030000 LH R8,DCBBLKSI LOAD INPUT BLKSIZE 00030100 READBLK READ DECB2,SF,CLISTIN,(4),(8) 00030200 SPACE 00030300 CHECK DECB2 00030400 SPACE 00030500 TM SWITCH,TEST20 IF INPUT IS F 00030600 BZ FTOV CONVERT FIXED TO VARIABLE 00030700 SPACE 2 00030800 VTOF EQU * 00030900 LH R12,0(R4) ADD BLKSIZE AND STARTING 00031000 AR R12,R4 ADDRESS 00031100 ST R12,ENDV GIVING ENDING ADDRESS 00031200 LR R6,R4 LOAD POINTER TO V INPUT 00031300 LA R6,4(R6) POINT TO FIRST LRECL 00031400 SPACE 00031500 GETREC MVC HALFWORD,0(R6) 00031600 LH R5,HALFWORD 00031700 CH R5,=H'255' IF LRECL IS GREATER THAN 256 00031800 BL PASTRDW ERROR *SBG 00031900 MVC ERRORMSG,MSG4 MESSAGE 00032000 MVC RC,=H'12' RETURN CODE 00032100 B WRITERR 00032200 PASTRDW SH R5,=H'12' POINT PAST 4 BYTE LRECL AND *SBG 00032300 LA R6,12(R6) 8 BYTE LINE SEQUENCE FIELD 00032400 SPACE 00032500 LOOPREC STH R5,LRECL SAVE LRECL 00032600 LA R12,0(R5,R6) POINT TO LAST BYTE OF REC *SBG 00032700 ST R12,SAVEWREG SAVE END OF RECORD *SBG 00032800 ST R5,SAVECREG SAVE BYTES TO BE MOVED. *SBG 00032900 ST R4,SAVE4REG SAVE REG 4 CONTENTS. WKREG. *SBG 00033000 LA R4,0 COUNTER FOR MOVE *SBG 00033100 BACKLOOP CR R4,R5 LIMITED SEARCH FOR TRL BLNKS*SBG 00033200 BNL FOUNDTE YES. NO NON-BLANKS IN RECD *SBG 00033300 CH R4,=H'70' LIMITED SEARCH FOR TRL BLNKS*SBG 00033400 BH FOUNDTE YES. NO NON-BLANKS IN RECD *SBG 00033500 CLI 0(R12),C' ' IS LAST BYTE A BLANK? *SBG 00033600 BNE FOUNDTE NO. FOUND TRUE END FOR CLIST*SBG 00033700 LA R4,1(,R4) BUMP COUNTER *SBG 00033800 B BACKLOOP KEEP TRYING *SBG 00033900 FOUNDTE SR R5,R4 *SBG 00034000 L R4,SAVE4REG RESTORE REGISTER 4. *SBG 00034100 CH R5,=H'72' IF LRECL 71 NOT COUNTING TR BLNKS *SBG 00034200 BH SPLITREC THEN SPLIT RECORD *SBG 00034300 BE EXACT72 EXACTLY 72 CHARS-SPECIAL TREATMENT*SBG 00034400 L R5,SAVECREG RESTORE R5, AND THEN *SBG 00034500 BCTR R5,0 MAKE LENGTH CODE ADJUSTMENT 00034600 SKIPLOOP L R12,SAVECREG RESTORE REGISTER 12. *SBG 00034700 MVC REC80,REC80-1 CLEAR RECORD AREA *SBG 00034800 EX R5,MOVE80 MOVE RECORD *SBG 00034900 BAL R11,WRITEF 00035000 LA R5,1(R5) 00035100 LA R6,0(R5,R6) INCREMENT CURRET POINTER BY LENG 00035200 NOTSPLIT C R6,ENDV *SBG IF ADDRESS POINTER IS LESS THAN 00035300 BL GETREC END ADDRESS GO TO GETREC 00035400 B READBLK ELSE READ A BLOCK 00035500 SPACE 2 00035600 EXACT72 LH R5,=H'71' DON'T DROP LAST CHARACTER *SBG 00035700 LA R12,0(R5,R6) ADDRESS OF END OF REC TO BE MOVE *SBG 00035800 MVC REC80,REC80-1 CLEAR OUTPUT RECORD *SBG 00035900 B MOVEMOUT NO CONTINUATION CHARACTER *SBG 00036000 SPLITREC EQU * 00036100 LH R5,=H'70' *SBG 00036200 SPLTLOOP LA R12,0(R5,R6) ADDRESS OF END OF REC TO BE MOVE 00036300 MVC REC80,REC80-1 CLEAR OUTPUT RECORD 00036400 MVI REC80+71,C'-' MOVE IN CONTUATION CHARACTER SBG 00036500 MOVEMOUT EX R5,MOVE80 MOVE TO WRITE AREA *SBG 00036600 BAL R11,WRITEF 00036700 LA R12,1(R5) ADD 1 REC LENGTH OF RECORD *SBG 00036800 LH R5,LRECL WRITEN 00036900 SR R5,R12 SUBTRACT FROM LRECL 00037000 LA R6,0(R12,R6) INCREMENT IPOINTER BY LENGTH 00037100 * IF LRECL IS EXACTLY 72, WE CAN COME HERE. NOW WE TEST FOR THAT. *SBG 00037200 LTR R5,R5 ARE WE ACTUALLY AT THE END OF A RECD?*SBG 00037300 BZ NOTSPLIT YES. DON'T ACT TO SPLIT THE RECORD. *SBG 00037400 B LOOPREC FINISH RECORD 00037500 SPACE 00037600 WRITEF EQU * 00037700 AP SEQCOUNT,=P'10' PLACE SEQUENCE NUMBER IN 00037800 UNPK REC80+72(8),SEQCOUNT POSITIONS 73-80 00037900 MVI REC80+79,C'0' MAKE LAST POS CHAR ZERO 00038000 MVC 0(80,R7),REC80 MOVE RECORD TO OUTPUT 00038100 LA R7,80(R7) INCREMENT POINTER 00038200 C R7,ENDF IF POINTER IS LESS THAN ENDOFBLK 00038300 BCR 4,R11 RETURN 00038400 SR R7,R3 LOAD BLKSIZE 00038500 B WRITEOUT ELSE WRITEOUT BLOCK 00038600 SPACE 2 00038700 FTOV EQU * 00038800 LA R12,0(R8,R4) FIND END OF BLOCK ADRESS 00038900 L R9,DECB2+16 LOAD IOB ADDRESS 00039000 LH R9,14(R9) LOAD LENGTH BLOCK IS SHORT 00039100 SR R12,R9 SUBTRACT FROM END OF FULL BLK 00039200 ST R12,ENDF GIVING REAL END OF BLOCK 00039300 LR R6,R4 POINT TO START OF INPUT BLOCK 00039400 NEXTFREC EQU * 00039500 LA R5,71(R6) POINT TO LAST CHAR *SBG 00039600 LOOPFV EQU * 00039700 CLI 0(R5),C' ' FIND LAST NON BLANK CHARACTER 00039800 BNE FOUNDATA 00039900 BCTR R5,0 00040000 B LOOPFV 00040100 SPACE 00040200 FOUNDATA EQU * 00040300 SR R5,R6 SUBTRACT START FROM END GIV LENG 00040400 CH R5,=H'1' 00040500 BH WRITEV IF LENGTH CODE IS LESS THAN 1 *SBG 00040600 LA R5,1 USE 1 00040700 WRITEV EQU * DO NOT PLAY GAMES WITH CONTIN CHARACTRS*SBG 00040800 LA R12,13(R5,R7) LOAD ADDRESS END OF OUTPUT REC 00040900 C R12,ENDV IF ENDOFREC IS LESS THAN ENDOFBL 00041000 BNH EXMOVEV MOVE DATA 00041100 SR R7,R3 ELSE FIND BLK LENGTH 00041200 STH R7,0(R3) STORE IN OUTPUT BLOCK 00041300 BAL R11,WRITEOUT WRITE BLOCK 00041400 LA R7,4(R7) POINT PAST OUTPUT BLK COUNT 00041500 SPACE 00041600 EXMOVEV EQU * 00041700 EX R5,MOVEV MOVE DATA TO OUTPUT BLOCK 00041800 AP SEQCOUNT,=P'10' PUT SEQUENCE NUMBER 00041900 UNPK 4(8,R7),SEQCOUNT IN OUTPUT DATA SET 00042000 MVI 11(R7),C'0' MAKE LAST DIGIT CHARACTER 0 00042100 LA R5,13(R5) ADD 13 TO LEN CNT GIVING LRECL 00042200 STH R5,HALFWORD 00042300 MVC 0(4,R7),HALFWORD STORE LRECL IN OUTPUT BLOCK 00042400 LA R7,0(R5,R7) INCREMENT OUTPUT POINTER 00042500 LA R6,80(R6) INCREMENT INPUT POINTER 00042600 C R6,ENDF IF LESS THAN END OF BLOCK 00042700 BL NEXTFREC GET NEXT RECORD 00042800 B READBLK ELSE GET NEXT BLOCK 00042900 SPACE 2 00043000 WRITEOUT EQU * 00043100 WRITE DECBA,SF,CLISTOUT,(R3),(R7) WRITE OUT BLOCK 00043200 SPACE 00043300 CHECK DECBA 00043400 SPACE 00043500 LR R7,R3 SET POINTER TO START OF BLOCK 00043600 BR R11 00043700 STOWOUT EQU * 00043800 TM SWITCH,TEST20 IF V TO F 00043900 BO STOWVTOF CHECK FOR SHORT BLOCK 00044000 SR R7,R3 FIND BLOCK LENGTH 00044100 STH R7,0(R3) STORE IN BDW 00044200 MVC 2(2,R3),=H'0' ZERO OUT REST OF BDW 00044300 B SHORTBLK WRITE OUT BLOCK 00044400 STOWVTOF CR R3,R7 IF OUTPUT BLOCK IS EMPTY 00044500 BE *+10 SKIP WRITING SHORT BLOCK 00044600 SR R7,R3 LOAD BLOCK LENGTH 00044700 SHORTBLK BAL R11,WRITEOUT WRITE SHORT BLOCK 00044800 TM SWITCH,X'40' IF DIRECTORY READ 00044900 BO EOJ GO TO EOJ 00045000 STOW CLISTOUT,DIRLIST,A 00045100 SPACE 00045200 B STOWEND(R15) 00045300 STOWEND B CHECKEND GOOD STOW 00045400 B ERRA 00045500 NOP ERRA 00045600 B ERRB 00045700 B ERRC 00045800 NOP ERRA 00045900 ERRD MVC ERRORMSG,MSGD 00046000 B ERR 00046100 ERRC MVC ERRORMSG,MSGC 00046200 B ERR 00046300 ERRB MVC ERRORMSG,MSGB 00046400 B ERR 00046500 ERRA MVC ERRORMSG,MSGA 00046600 ERR MVC RC,=H'12' 00046700 B WRITERR 00046800 SPACE 00046900 CHECKEND EQU * 00047000 AP OUTCOUNT,=P'1' COUNT MEMBERS MOVED 00047100 TM SWITCH,TEST20 IF V TO F 00047200 BO *+8 CHECK DIRECTORY 00047300 LA R7,4(R7) ELSE ADD 4 BYTES FOR OUTPUT BDW 00047400 LA R12,2 00047500 CH R12,DIRLEFT IF DIRECTORY BLOCK IS NOT EMPTY 00047600 BL GETMEM GET NEXT MEMBER 00047700 POINT CLISTIN,SAVETTR ELSE READ NEW DIRECTORY 00047800 SPACE 00047900 B READDIR 00048000 SPACE 2 00048100 WRITERR EQU * 00048200 BAL R11,WRITETIT 00048300 MVC PRTLINE,ERRLINE 00048400 BAL R11,PUTPRINT 00048500 CLC RC,=H'12' IF COPY STARTED 00048600 BNE EXIT PRINT TOTALS 00048700 BAL R11,COUNTP 00048800 B EXIT 00048900 SPACE 2 00049000 EOJ BAL R11,WRITETIT 00049100 MVC ERRORMSG(14),=C' COPY COMPLETE' 00049200 MVC PRTLINE,ERRLINE 00049300 BAL R11,PUTPRINT 00049400 BAL R11,COUNTP 00049500 SPACE 2 00049600 EXIT EQU * 00049700 CLOSE (CLISTIN,,CLISTOUT,,PRINT) 00049800 LH R15,RC LOAD RETURN CODE 00049900 L R13,SAVEAREA+4 00050000 LM R0,R12,20(R13) RESTORE REGS 0-12 00050100 L R14,12(R13) RESTORE REG 14 00050200 BR R14 00050300 SPACE 2 00050400 WRITETIT EQU * 00050500 OPEN (PRINT,(OUTPUT)) 00050600 MVC PRTLINE,TITLE 00050700 LH R12,RC 00050800 CVD R12,WORK 00050900 UNPK RCP,WORK 00051000 OI RCP+1,X'F0' 00051100 B PUTPRINT 00051200 COUNTP UNPK OUTP,OUTCOUNT MOVE NO OF MEMBERS MOVED 00051300 OI OUTP+4,X'F0' TO PRINTLINE 00051400 MVC PRTLINE,COUNTLN 00051500 SPACE 00051600 PUTPRINT PUT PRINT,PRTLINE 00051700 SPACE 00051800 BR R11 00051900 SPACE 2 00052000 *EXECUTED INSTRUCTIONS 00052100 MOVEV MVC 12(1,R7),0(R6) 00052200 MOVE80 MVC REC80(1),0(R6) 00052300 EJECT 00052400 CLISTIN DCB DSORG=PO,MACRF=R,DDNAME=SYSUT1,EODAD=STOWOUT 00052500 SPACE 2 00052600 CLISTOUT DCB DSORG=PO,MACRF=W,DDNAME=SYSUT2 00052700 SPACE 2 00052800 PRINT DCB DSORG=PS,MACRF=PM,DDNAME=SYSPRINT,RECFM=FBA, X00052900 LRECL=121,BLKSIZE=605 00053000 EJECT 00053100 *WORK FIELDS 00053200 SPACE 00053300 WORK DC D'0' 00053400 FULLWORD DS 0F 00053500 HALFWORD DC H'0' 00053600 DC H'0' 00053700 SAVETTR DC F'0' 00053800 READADD DC F'0' 00053900 ENDV DC F'0' 00054000 ENDF DC F'0' 00054100 SAVERTN DC F'0' 00054200 NEXTMEM DC F'0' 00054300 SAVECREG DC F'0' *SBG 00054400 SAVEWREG DC F'0' *SBG 00054500 SAVE4REG DC F'0' *SBG 00054600 SAVEHALF DC H'0' *SBG 00054700 OUTBLKSI DC H'0' 00054800 DIRLEFT DC H'0' 00054900 BLKIN DC H'0' 00055000 RECIN DC H'0' 00055100 RC DC H'0' 00055200 LRECL DC H'0' 00055300 OUTCOUNT DC PL4'0' 00055400 DIRSW DC X'00' 00055500 SWITCH DC XL1'00' 00055600 HIVALUE DC XL8'FFFFFFFFFFFFFFFF' 00055700 SEQCOUNT DC PL4'0' 00055800 SPACE 00055900 DS 0F 00056000 DIRIN DS CL256 DIRECTORY BLOCK 00056100 SPACE 00056200 DS 0F 00056300 DIRLIST DS 0CL74 DIRECTORY RECORD 00056400 NAME DC CL8' ' 00056500 TTR DS CL3 00056600 C DS CL1 00056700 USEADATA DS CL62 00056800 DC CL1' ' 00056900 SPACE 00057000 REC80 DS CL80 00057100 SPACE 2 00057200 *PRINT DATA 00057300 SPACE 00057400 TITLE DC CL121'1 CLIST CONVERSION' 00057500 ERRLINE DS 0CL121 00057600 DC CL7'0 RC=' 00057700 RCP DC CL2' ' 00057800 DC CL5' ' 00057900 ERRORMSG DC CL37' ' 00058000 DC CL70' ' 00058100 COUNTLN DS 0CL121 00058200 DC CL29'0' 00058300 OUTP DC CL5'0' 00058400 DC CL87' MEMBERS COPIED' 00058500 PRTLINE DS CL121 00058600 SPACE 00058700 MSG1 DC CL37'FILE NOT V OR F' 00058800 MSG2 DC CL37'F FORMAT MUST BE LRECL 80' 00058900 MSG3 DC CL37'INPUT AND OUTPUT CANNOT BE SAME RECFM' 00059000 MSG4 DC CL37'V RECORD WITH LRECL OVER 256' 00059100 MSGA DC CL37'DUPLICATE NAME ON DIRECTORY-SYSUT2' 00059200 MSGB DC CL37'DIRECTORY OUT OF SPACE' 00059300 MSGC DC CL37'I/O ERROR ON SYSUT2 DIRECTORY' 00059400 MSGD DC CL37'PROGRAM REGION TOO SMALL' 00059500 LTORG 00059600 DCBDUM DCBD DSORG=PO,DEVD=DA 00059700 END 00059800