Fun With Chaotic Code
Posted: Wed Dec 12, 2012 8:12 am
related to http://www.ibmmainframeforum.com/assembler/topic8541.html
I was working on my stuff and I put something together. The main point of what is below is I have something to work with right now. I would like you to not point out how much this code sucks and show how much it doesn't work, as I already know that. What I'm trying to do is understand how to look at individual characters in given input text, to respond accordingly in my given algorithm.
thanks
COPY SETUP
OPEN (INFILE,INPUT)
OPEN (OUTFILE,OUTPUT)
notEOF EQU *
ANYCHAR EQU *
OUTPUT = FILE CHARAT(X,Y);
AP INCREMENT,=P'1' ITERATOR
LA 0,INPUT1
LA 1,L’INPUT1
LA 14,COMMA
LA 15,L’COMMA
ICM 15,B’1000’,=X’40’
CLCL 0,14
BZ OUT
B ANYCHAR EQU *
OUT EQU *
MVC ORECORD(COUNT),IRECORD
PUT OUTFILE,ORECORD
B notEOF EQU *
EOF DS 0H
CLOSE (INFILE)
CLOSE (OUTFILE)
WTO 'PROG4 ENDED OK'
ENDIT
INFILE DCB DDNAME=INPUT, X
DSORG=PS, X
EODAD=EOF, X
LRECL=80, X
RECFM=FB, X
MACRF=(GM)
*
OUTFILE DCB DDNAME=OUTPUT, X
LRECL=80, X
DSORG=PS, X
RECFM=FB, X
MACRF=(PM), X
BLKSIZE=160
*
END COPY
I was working on my stuff and I put something together. The main point of what is below is I have something to work with right now. I would like you to not point out how much this code sucks and show how much it doesn't work, as I already know that. What I'm trying to do is understand how to look at individual characters in given input text, to respond accordingly in my given algorithm.
thanks
COPY SETUP
OPEN (INFILE,INPUT)
OPEN (OUTFILE,OUTPUT)
notEOF EQU *
ANYCHAR EQU *
OUTPUT = FILE CHARAT(X,Y);
AP INCREMENT,=P'1' ITERATOR
LA 0,INPUT1
LA 1,L’INPUT1
LA 14,COMMA
LA 15,L’COMMA
ICM 15,B’1000’,=X’40’
CLCL 0,14
BZ OUT
B ANYCHAR EQU *
OUT EQU *
MVC ORECORD(COUNT),IRECORD
PUT OUTFILE,ORECORD
B notEOF EQU *
EOF DS 0H
CLOSE (INFILE)
CLOSE (OUTFILE)
WTO 'PROG4 ENDED OK'
ENDIT
INFILE DCB DDNAME=INPUT, X
DSORG=PS, X
EODAD=EOF, X
LRECL=80, X
RECFM=FB, X
MACRF=(GM)
*
OUTFILE DCB DDNAME=OUTPUT, X
LRECL=80, X
DSORG=PS, X
RECFM=FB, X
MACRF=(PM), X
BLKSIZE=160
*
END COPY