The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: RISCCISCInstSet on October 12, 2011, 06:20:48 AM

Title: Program to be Added (IBM z/OS Assembler)
Post by: RISCCISCInstSet on October 12, 2011, 06:20:48 AM
What I'm trying to understand: how do these code snippets interlock? Do they even connect to each other at all?!

Could you explain what is going on/how to connect them or how to connect a program?


COPY     SUBENTRY
    program to be added
      SUBEXIT
INFILE   DCB   DDNAME=INFILE,                                          X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               LRECL=80,                                               X
               EODAD=EOF,                                              X
               MACRF=GM
*
OUTFILE  DCB   DDNAME=OUTFILE,                                         X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               LRECL=133,                                              X
               MACRF=PM
*
IRECORD  DC    CL80' '
ORECORD  DC    CL133' '


         TITLE 'PROGRAM 4 80/80 LISTING'
         PRINT NOGEN
COPY     SUBENTRY
         WTO   'PROG4 COPY INFILE (ASCII) TO OUTFILE (ASCII)'
         OPEN  (INFILE,INPUT)
         OPEN  (OUTFILE,OUTPUT)
         WTO   'Files opened successfully'
*
LOOP     EQU   *
         GET   INFILE,IRECORD
         MVC   ORECORD,=CL133' '
         MVC   ORECORD(80),IRECORD
         PUT   OUTFILE,ORECORD
         B     LOOP
*
EOF      EQU   *
         CLOSE (INFILE,,OUTFILE)
         WTO   'PROG4 ENDED OK'
         SUBEXIT
Title: Re: Program to be Added (IBM z/OS Assembler)
Post by: clive on October 12, 2011, 03:07:23 PM
You're in totally the wrong place, but the following would seem to be the logical inference.

         TITLE 'PROGRAM 4 80/80 LISTING'
         PRINT NOGEN
COPY     SUBENTRY
         WTO   'PROG4 COPY INFILE (ASCII) TO OUTFILE (ASCII)'
         OPEN  (INFILE,INPUT)
         OPEN  (OUTFILE,OUTPUT)
         WTO   'Files opened successfully'
*
LOOP     EQU   *
         GET   INFILE,IRECORD
         MVC   ORECORD,=CL133' '
         MVC   ORECORD(80),IRECORD
         PUT   OUTFILE,ORECORD
         B     LOOP
*
EOF      EQU   *
         CLOSE (INFILE,,OUTFILE)
         WTO   'PROG4 ENDED OK'
         SUBEXIT
INFILE   DCB   DDNAME=INFILE,                                          X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               LRECL=80,                                               X
               EODAD=EOF,                                              X
               MACRF=GM
*
OUTFILE  DCB   DDNAME=OUTFILE,                                         X
               DSORG=PS,                                               X
               RECFM=FT,                                               X
               LRECL=133,                                              X
               MACRF=PM
*
IRECORD  DC    CL80' '
ORECORD  DC    CL133' '
Title: Re: Program to be Added (IBM z/OS Assembler)
Post by: RISCCISCInstSet on October 12, 2011, 05:43:44 PM
 :U Thank you for your help; this code has been stumping me for some time.

Title: Re: Program to be Added (IBM z/OS Assembler)
Post by: NoCforMe on October 12, 2011, 10:15:41 PM
What is that, S/370 code? Gawd, that takes me back. Used to be a COBOL programmer. JCL and all that. Looks like an 80-character "data card" and a 133-character line printer, no?