Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Cobol/verschiedene-Autoren/Rainers-Beispiele/   (verschiedene Autoren Version 0.7©)  Datei vom 4.1.2008 mit Größe 2 kB image not shown  

Quelle  last50-dynamisch.cob   Sprache: Cobol

 

       Identification Division.
       Program-Id. last50d.
       Environment Division.
       Input-Output Section.
       Data Division.
       Working-Storage Section.
       01 row        pic S9(8) occurs 100.
       77 anzahl     pic S9(8).
       77 von-lfdnr  pic S9(8).
       77 bis-lfdnr  pic S9(8).
       01 mysqlx-fetch-array occurs 100.
         05 zeile pic X(80).
       77 sql-code   pic S9(8).
       77 sqlx       pic x(80).
       77 result     pic x(80).
       01 this.
         05 log        pic x(80).
       77 die-par    pic x(80).
       Procedure Division.
      * Es werden die letzten 50 LOGIN angelistet
         string " Select sqlx-SMALL-RESULT MAX(lfdnr) as anzahl ";
                " from ta-logging "
         delimited by size into sqlx.
         call MYsqlx-QUERY using sqlx, result
         if result=0 
           display "<br> F E H L E R <BR>" sqlx "<br>"
           display "<br>" sql-code "<br>"
           call MYsqlx-CLOSE
           string "ABBRUCH: Fehler beim Lesen ta-logging für "
                  "Statuskontrolle (select #3)<br>"
           into die-par
           call die using die-par
         else
           call MYsqlx-FETCH-array using result 1 row
           move row('anzahl') to anzahl
         end-if
         if anzahl <= 50 
           move 0 to von-lfdnr
         else
           compute von-lfdnr = anzahl - 50;
         end-if
         compute bis-lfdnr = 99;
         string " Select * "
                " from ta-logging ";
                " LIMIT $von-lfdnr,$bis-lfdnr "
         into sqlx
         call MYsqlx-QUERY using sqlx result
         if result=0 then
           display "<br> F E H L E R <BR>" sqlx "<br>"
           display "<br>" sql-code "<br>"
           call MYsqlx-CLOSE
           string "ABBRUCH: Fehler beim Lesen ta-logging für "
                  "Statuskontrolle (select #4)<br>"
           delimited by size into die-par
           call die using die-par
         else
           perform until row not= MYsqlx-FETCH-array(result,1) 
             move row to log of this
           end-perform
         end-if
       End-Program last50d.

Messung
CHZG
989910098

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-25) ¤

*© Formatika GbR, Deutschland