Dia Da Semana

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Dia Da Semana as PDF for free.

More details

  • Words: 311
  • Pages: 2
* Dia da Semana 77 WK-DIAS PIC 9(008) BINARY. 77 DATA-DESEJADA PIC 9(008). * AAAAMMDD 77 WK-SOBRA PIC 9(008) BINARY. COMPUTE WK-DIAS = FUNCTION INTEGER-OF-DATE(DATA-DESEJADA) COMPUTE WK-SOBRA = (FUNCTION REM (WK-DIAS 7)) + 1 SE WK-SOBRA FOR 1 = DOMINGO 2 = SEGUNDA 3 = TERÇA 4 = QUARTA 5 = QUINTA 6 = SEXTA 7 = SÁBADO COMPUTE WS-DIA-SEMANA = 1 + ( FUNCTION REM ( FUNCTION INTEGER-OF-DATE ( WS-SUA-DATA ), 7 ) ) EVALUATE WS-DIA-SEMANA WHEN 1 MOVE "DOMINGO" TO WS-CAMPO WHEN 2 MOVE "SEGUNDA" TO WS­CAMPO     WHEN 3 MOVE "TERCA  " TO WS­CAMPO     WHEN 4 MOVE "QUARTA " TO WS­CAMPO     WHEN 5 MOVE "QUINTA " TO WS­CAMPO     WHEN 6 MOVE "SEXTA  " TO WS­CAMPO     WHEN 7 MOVE "SABADO " TO WS­CAMPO END­EVALUATE

tem outro jeito de pegar o dia da semana, porém é o dia corrente. Pedro Junior Cobol MF + POWER + NET IDENTIFICATION DIVISION. PROGRAM-ID. DIASEM. * SABER DIA DA SEMANA. AUTHOR. PJR-DESENVOLVIMENTO CONSULTORIA EM INFORMATICA S/C LTDA. DATE-WRITTEN. 08/11/2007. DATE-COMPILED. 08/11/2007. ENVIRONMENT DIVISION. CONFIGURATION SECTION. SPECIAL-NAMES. DECIMAL-POINT IS COMMA. INPUT-OUTPUT SECTION. FILE-CONTROL. DATA DIVISION. FILE SECTION. WORKING-STORAGE SECTION. 01 DIASEMANA PIC X(10) VALUE SPACES. 01 DIASEMR REDEFINES DIASEMANA. 02 D1 PIC X(02). 02 D2 PIC X(08).

PROCEDURE DIVISION. INIC1. DISPLAY (01, 01) ERASE. ACCEPT DIASEMANA FROM DAY-OF-WEEK. IF D1 = "1" MOVE "SEGUNDA" TO D2. IF D1 = "2" MOVE "TERCA" TO D2.

IF D1 = "3" MOVE "QUARTA" TO D2. IF D1 = "4" MOVE "QUINTA" TO D2. IF D1 = "5" MOVE "SEXTA" TO D2. IF D1 = "6" MOVE "SABADO" TO D2. IF D1 = "7" MOVE "DOMINGO" TO D2. DISPLAY D1 " " D2. EXIT PROGRAM STOP RUN.

No MF é possível pegar o dia da semana assim: 77 dia pic 9. procedure division. accept dia from day-of-week evaluate dia when 0 stop "domingo" when 1 stop "segunda" ..... end-evaluate goback.

Related Documents

Dia Da Semana
November 2019 18
Semana 6, Dia 1
November 2019 15
Desdobr Dia Da Terra
April 2020 16
Dia Da Mulher.docx
December 2019 17
Google Dia Da Mentira
December 2019 25
Dia Da Arvore_projeto Pomar
November 2019 23