Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //TEST2 JOB 'SEZEN',CLASS=A,NOTIFY=&SYSUID,MSGCLASS=H,
- // MSGLEVEL=(1,1)
- // EXEC ASMACLG
- //C.SYSOUT DD SYSOUT=*
- //C.SYSIN DD *
- PRINT ON,NODATA,NOGEN I KINDA UNDERSTAND THIS PART
- NEW CSECT
- STM R14,R12,12(R13)
- BASR R12,R0 ESTABLISHING ADDRESSABILITY
- USING *,R12
- ST R13,SAVE+4 STORING CALLERS REGISTERS
- LA R13,SAVE I'M PRETTY SURE
- **********************************
- * START OF PROGRAM *
- **********************************
- MAIN OPEN (FILEIN,(INPUT)) OPEN INPUT
- OPEN (FILEOUT,(OUTPUT)) OPEN OUTPUT
- **********************************
- * BEGIN MAIN LOOP!! *
- **********************************
- LOOP EQU * BEGIN LOOP
- * COUNTS EACH CYCLE FOR DEBUG
- AP ACC,ONE START ACCUMULATOR
- MVC OUTACC,EDWD CONVERTS TO READABLE FORMAT
- ED OUTACC,ACC CONVERT PD TO CHARACTER
- *** GET FILES AND ASSIGN DATES ***
- GET FILEIN,RECIN GET FILE
- MVC DATE,RECIN PUT RECORD INTO DATE
- MVC DAYOUT,DAY PUT DAY INTO PRINTED FIELD
- MVC YEAROUT,YEAR PUT YEAR INTO PRINTED FIELD
- *** CONDITIONALS FOR MONTHS *****
- CLC MONTH,NDEC IF MONTH > 12 THEN ERROR
- BH ERROR
- CLC MONTH,NJAN IF MONTH < 01 THEN ERROR
- BL ERROR
- CLC MONTH,NJAN CONDITIONAL TO ASSIGN MONTH..
- BE JAN TO A WORD, CHECKING MONTH
- CLC MONTH,NFEB THERES CERTAINLY A BETTER WAY
- BE FEB BUT MY KNOWLEDGE IS LIMITED
- CLC MONTH,NMAR FOR NOW!
- BE MAR
- CLC MONTH,NAPR IF MONTH = ##
- BE APR
- CLC MONTH,NMAY
- BE MAY
- CLC MONTH,NJUN
- BE JUN
- CLC MONTH,NJUL
- BE JUL
- CLC MONTH,NAUG
- BE AUG
- CLC MONTH,NSEP
- BE SEP
- CLC MONTH,NOCT
- BE OCT
- CLC MONTH,NNOV
- BE NOV
- MVC MONTHOUT,CDEC DEC IS ONLY ONE LEFT
- ***** 2ND PART OF LOOP ******* SECOND PART OF LOOP
- CONT EQU *
- PUT FILEOUT,OUTMSG PRINT OUR MSG
- B LOOP BRANCH CAUSE NOT EOF
- ********************************
- * FINISHING UP, END OF LOOP ** FINISHING UP
- ********************************
- FINISH EQU *
- CLOSE FILEIN CLOSE FILES
- CLOSE FILEOUT
- ******** EXIT ********
- L R13,SAVE+4 RETURN REGISTERS
- LM R14,R12,12(R13)
- LA R15,0
- BR R14 RETURN TO OS
- *********************************
- * INPUT FILE *
- **********************************
- FILEIN DCB DSORG=PS,MACRF=(GM),DDNAME=FILEIN,EODAD=FINISH, X
- RECFM=FB,LRECL=80
- RECIN DS CL80' '
- *********************************
- * OUTPUT FILE *
- *********************************
- FILEOUT DCB DSORG=PS,MACRF=(PM),DDNAME=FILEOUT,RECFM=FB,LRECL=80
- *********************************
- * MONTHS *
- *********************************
- JAN EQU * ISNT THIS A MESS?
- MVC MONTHOUT,CJAN
- B CONT
- FEB EQU *
- MVC MONTHOUT,CFEB MOVING CHARACTER MONTH TO
- B CONT OUTPUT.
- MAR EQU *
- MVC MONTHOUT,CMAR
- B CONT
- APR EQU *
- MVC MONTHOUT,CAPR
- B CONT
- MAY EQU *
- MVC MONTHOUT,CMAY
- B CONT
- JUN EQU *
- MVC MONTHOUT,CJUN
- B CONT
- JUL EQU *
- MVC MONTHOUT,CJUL
- B CONT
- AUG EQU *
- MVC MONTHOUT,CAUG
- B CONT
- SEP EQU *
- MVC MONTHOUT,CSEP
- B CONT
- OCT EQU *
- MVC MONTHOUT,COCT
- B CONT
- NOV EQU *
- MVC MONTHOUT,CNOV
- B CONT
- *******************************
- * ERROR BRANCH *
- *******************************
- ERROR EQU * SENDING OUR ERROR MESSAGE
- PUT FILEOUT,ERRORMSG
- B FINISH BRANCH TO END OF PROGRAM
- ************************************
- * LITERAL POOL (AKA DISASTER ZONE) *
- ************************************
- LTORG
- EDWD DC X'212020' IDK HOW FORMATTING WORKS RLY
- ACC DC PL2'0' ACCUMULATOR
- ONE DC PL1'1' THE NUMBER ONE
- ****** CHARACTER MONTHS ******
- CJAN DC C'JAN' MVC = SS INSTRUCTION
- CFEB DC C'FEB'
- CMAR DC C'MAR'
- CAPR DC C'APR'
- CMAY DC C'MAY'
- CJUN DC C'JUN'
- CJUL DC C'JUL'
- CAUG DC C'AUG'
- CSEP DC C'SEP'
- COCT DC C'OCT'
- CNOV DC C'NOV'
- CDEC DC C'DEC'
- ****** NUMBER MONTHS ******
- NJAN DC C'01' DECLARING NUMBER OF MONTH
- NFEB DC C'02'
- NMAR DC C'03'
- NAPR DC C'04'
- NMAY DC C'05'
- NJUN DC C'06'
- NJUL DC C'07'
- NAUG DC C'08'
- NSEP DC C'09'
- NOCT DC C'10'
- NNOV DC C'11'
- NDEC DC C'12'
- *****************************
- * ERROR MESSAGE *
- *****************************
- ERRORMSG DS CL80
- ORG ERRORMSG
- EMSG1 DC CL48'HEY BUDDY, YOU DIDNT PUT A VALID DATE. FIX IT! '
- EMSG2 DC CL23'THE PROB IS DATE NUMBER '
- OUTACC DS CL10
- ORG ,
- ****************************
- * DATE FORMATTING *
- ****************************
- DATE DS CL8 SPLIT OUR DATE INTO
- ORG DATE SUB-FIELDS
- YEAR DS CL4
- MONTH DS CL2
- DAY DS CL2
- ORG , FINISHING THAT
- ****************************
- * OUR END RESULT MESSAGE *
- ****************************
- OUTMSG DS CL80 STARTING OUR MSG...
- ORG OUTMSG
- MSG1 DC C'THE MONTH IS: '
- MONTHOUT DS CL3
- BLANKS1 DC CL2', '
- MSG2 DC C'THE YEAR IS: '
- YEAROUT DC CL4' '
- BLANKS2 DC CL2', '
- MSG3 DC C'THE DAY IS: '
- DAYOUT DS CL2
- BLANKS DC CL25' '
- ORG ,
- * OUTPUTS 'THE MONTH IS: ##, THE YEAR IS: ##, THE DAY IS: ##'
- *
- *************************** DEFINING REGISTERS
- * REGISTERS *
- ***************************
- R0 EQU 0
- R6 EQU 6
- R5 EQU 5
- R12 EQU 12
- R13 EQU 13
- R14 EQU 14
- R15 EQU 15
- SAVE DS 18F
- END NEW
- /*
- //G.SYSUDUMP DD SYSOUT=*
- //G.FILEOUT DD SYSOUT=*
- //SETVAR SET MASTER=&SYSUID..TEST(DATES)
- //G.FILEIN DD DSN=&MASTER,DISP=SHR
- /*
- //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement