Page 1 of 1

I can't get Sysout on Array program

PostPosted: Sun Sep 26, 2010 7:24 am
by GUI1504
Hello everybody, i'm programming a example program to use arrays and i can't get sysout. I'm try to compile with two different JCL, but the result is the same. Anyone can help me?

COBOL
       IDENTIFICATION DIVISION.
       PROGRAM-ID. VOGAIS.

       ENVIRONMENT DIVISION.
      *
       DATA DIVISION.
      *
       WORKING-STORAGE SECTION.
      *
       01 WS-NOMES.
          05 WS-NOME     PIC X(1)  OCCURS 7 TIMES.
       01 WS-VOGAIS.
          05 WS-VOGAL    PIC X(1)  OCCURS 7 TIMES.
       01 WS-CONSOANTES.
          05 WS-CONS     PIC X(1)  OCCURS 7 TIMES.
       01 WS-IND-NOM     PIC 9(2).
       01 WS-IND-VOG     PIC 9(2)  VALUE 1.
       01 WS-IND-CON     PIC 9(2)  VALUE 1.
       01 WS-VOG-CONT    PIC 9(2)  VALUE 0.
       01 WS-CON-CONT    PIC 9(2)  VALUE 0.
      *
       PROCEDURE DIVISION.
      *
       MAIN.
           PERFORM NOME.
           PERFORM VERIFICA
           VARYING WS-IND-NOM FROM 1 BY 1
           UNTIL WS-IND-NOM > 7.
      *
           DISPLAY WS-NOME(WS-IND-NOM).
           DISPLAY 'NUMERO DE VOGAIS = ' WS-VOG-CONT.
           DISPLAY 'VOGAIS = ' WS-VOGAL(WS-IND-VOG).
           DISPLAY 'NUMERO DE CONSOANTES = ' WS-CON-CONT.
           DISPLAY 'CONSOANTES = ' WS-CONS(WS-IND-CON).
      *
       NOME.
           MOVE 'R' TO WS-NOME(1).
           MOVE 'O' TO WS-NOME(2).
           MOVE 'B' TO WS-NOME(3).
           MOVE 'E' TO WS-NOME(4).
           MOVE 'R' TO WS-NOME(5).
           MOVE 'T' TO WS-NOME(6).
           MOVE 'O' TO WS-NOME(7).
      *
       VERIFICA.
           IF WS-NOME(WS-IND-NOM) EQUAL 'A' OR EQUAL 'E' OR EQUAL 'I'
           OR EQUAL 'O' OR EQUAL 'U'
              MOVE WS-NOME(WS-IND-NOM) TO WS-VOGAL(WS-IND-VOG)
              ADD 1 TO WS-IND-VOG
              ADD 1 TO WS-VOG-CONT
           ELSE
              MOVE WS-NOME(WS-IND-NOM) TO WS-CONS(WS-IND-CON)
              ADD 1 TO WS-IND-CON
              ADD 1 TO WS-CON-CONT
           END-IF
           .
           STOP RUN.


JCL
//GUI1504C     JOB (GUI1504),GUI1504,CLASS=A,MSGCLASS=X,NOTIFY=GUI1504
//PROCLIB      JCLLIB ORDER=IBMMFS.PROC.IBMCOB
//STEP1        EXEC IGYWCG
//COBOL.SYSIN  DD DSN=GUI1504.COBOL.VOGAL,DISP=SHR
//SYSOUT      DD SYSOUT=*
/*

Re: I can't get Sysout on Array program

PostPosted: Sun Sep 26, 2010 8:08 am
by dick scherrer
Hello,

The only compile jcl you should use is the standard compile (or compile, link, and go) for the system you are using.

What do you mean "and i can't get sysout"? Suggest you insert a display at the beginning of the program. . .

You problem appears to be the code rather than the compile jcl. The first time thru VERIFICA, the program will terminate having done no displays. . .

Re: I can't get Sysout on Array program

PostPosted: Sun Sep 26, 2010 10:36 am
by NicC
You may be running Compile/Link/Go. If you have compiled and linked OK - have you supplied a DD for SYSOUT? There is one in your JCL but it is assigned to the COBOL step because you have not given it a stepname.