This is the source code:
ID DIVISION.
PROGRAM-ID. PROGZ002
*
*PROGRAMA - CALCULAR A MEDIA DE 4 NOTAS
*
DATA DIVISION.
WORKING-STORAGE SECTION.
*
01 N1 PIC 99V99 VALUE 0.
01 N2 PIC 99V99 VALUE 0.
01 N3 PIC 99V99 VALUE 0.
01 N4 PIC 99V99 VALUE 0.
77 MEDIA PIC 99V99 VALUE 0.
*
PROCEDURE DIVISION.
ACCEPT N1 FROM SYSIN.
ACCEPT N2 FROM SYSIN.
ACCEPT N3 FROM SYSIN.
ACCEPT N4 FROM SYSIN.
ACCEPT N4 FROM SYSIN.
COMPUTE MEDIA = (N1 + N2 + N3 + N4) / 4.
DISPLAY '* PROGRAMA PARA CALCULAR MEDIA DE 4 NOTAS'.
DISPLAY '*'.
DISPLAY '* NOTA 1: ' N1.
DISPLAY '* NOTA 2: ' N2.
DISPLAY '* NOTA 3: ' N3.
DISPLAY '* NOTA 4: ' N4.
DISPLAY '*'.
DISPLAY '* MEDIA => ' MEDIA.
STOP RUN.
PROGRAM-ID. PROGZ002
*
*PROGRAMA - CALCULAR A MEDIA DE 4 NOTAS
*
DATA DIVISION.
WORKING-STORAGE SECTION.
*
01 N1 PIC 99V99 VALUE 0.
01 N2 PIC 99V99 VALUE 0.
01 N3 PIC 99V99 VALUE 0.
01 N4 PIC 99V99 VALUE 0.
77 MEDIA PIC 99V99 VALUE 0.
*
PROCEDURE DIVISION.
ACCEPT N1 FROM SYSIN.
ACCEPT N2 FROM SYSIN.
ACCEPT N3 FROM SYSIN.
ACCEPT N4 FROM SYSIN.
ACCEPT N4 FROM SYSIN.
COMPUTE MEDIA = (N1 + N2 + N3 + N4) / 4.
DISPLAY '* PROGRAMA PARA CALCULAR MEDIA DE 4 NOTAS'.
DISPLAY '*'.
DISPLAY '* NOTA 1: ' N1.
DISPLAY '* NOTA 2: ' N2.
DISPLAY '* NOTA 3: ' N3.
DISPLAY '* NOTA 4: ' N4.
DISPLAY '*'.
DISPLAY '* MEDIA => ' MEDIA.
STOP RUN.
And I'm using this JCL to execute it:
//GPAL03EX JOB MSGLEVEL=1,CLASS=C,MSGCLASS=X,NOTIFY=GPAL03,TIME=(,20)
//*
// EXEC PGM=PROGZ002
//STEPLIB DD DSN=GP.GERAL.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN DD *
100
050
080
070
/*
//*
// EXEC PGM=PROGZ002
//STEPLIB DD DSN=GP.GERAL.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN DD *
100
050
080
070
/*
And this is my output in SDSF spool(The SYSOUT):
********************************* TOP OF DATA **********************************
* PROGRAMA PARA CALCULAR MEDIA DE 4 NOTAS
*
* NOTA 1: 100
* NOTA 2: 050
* NOTA 3: 080
* NOTA 4: 070
*
* MEDIA => 0750
******************************** BOTTOM OF DATA ********************************
* PROGRAMA PARA CALCULAR MEDIA DE 4 NOTAS
*
* NOTA 1: 100
* NOTA 2: 050
* NOTA 3: 080
* NOTA 4: 070
*
* MEDIA => 0750
******************************** BOTTOM OF DATA ********************************
Question is: I would like to format the N1, N2, N3, N4 and MEDIA values to show, not as 100, 050, 080, 070 and 0750, but as this:
N1: 10,0
N2: 5,0
N3: 8,0
N4: 7,0
and
MEDIA: 7,5
So, any help? Thanks in advance!