I can't get Sysout on Array program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

I can't get Sysout on Array program

Postby GUI1504 » Sun Sep 26, 2010 7:24 am

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=*
/*
GUI1504
 
Posts: 28
Joined: Fri Sep 03, 2010 10:40 pm
Location: Campinas, SP - Brazil
Has thanked: 0 time
Been thanked: 0 time

Re: I can't get Sysout on Array program

Postby dick scherrer » Sun Sep 26, 2010 8:08 am

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: I can't get Sysout on Array program

Postby NicC » Sun Sep 26, 2010 10:36 am

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post