Thursday 23 November 2017

Cobol Bilde Klausul Binære Alternativer


USAGE-klausul. USAGE-klausulen spesifiserer formatet til et dataelement i dataminnet eller i en filoppføring. Under noen omstendigheter kan et dataelement s filopptaksformat avvike fra datamaskinens minneformat som angitt i USAGE-klausulen. Dette kan oppstår når ikke-COBOL-filsystemer med forskjellige datalagringsformater er tilgjengelige via et grensesnitt. For eksempel bruker Acu4GL SQL for å få tilgang til ikke-COBOL-filsystemer, og i prosessen skjer det en oversettelse på dataene. Merk Det finnes mange kompilatoralternativer for påvirker datalagringsadferd Se Data Lagringsalternativer i ACUCOBOL-GT-kompatibilitets-delen. Kolonnen til venstre viser de aksepterte forkortelsene for vilkårene til høyre. En USAGE-klausul kan brukes i alle databeskrivelser, unntatt de med nivå nummer 66 , 78 og 88. Bruksklausul kan ikke brukes med en ekstern flytende punktdatapost. Hvis en USAGE-klausul er i databeskrivelsesoppføringen for et gruppepunkt, så er noen bruksklausuler som vises for underordnet entrie s må være av samme type. PICTURE-strengen i COMP, COMP-3, COMP-4, COMP-5, COMP-6, BINARY eller PACKED-DECIMAL-elementet kan bare inneholde Symbolene 9, S, V og P COMP-6 kan ikke bruke S-symbolet. BILD-strengen i COMP-X eller COMP-N-elementet kan bare inneholde alle 9 symboler eller alle X-symbolene. Databeskrivelsen for en ANVENDELSE ER INDEX data element kan ikke inneholde noen av følgende klausuler BLANK NÅR NUL, JUSTIFISERT, BILDE, og VALUE IS. Level 88 elementer kan ikke spesifiseres for en USAGE IS INDEX data item. The data beskrivelsen oppføring for en USAGE IS POINTER data element kan ikke inneholde noen av de følgende klausulene BLANKEN NÅR NED, RETTET, eller PICTURE A POINTER-datapost kan ha en verdiklausul angitt for den, men verdien må være ordet NULL. Databeskrivelsen for en BRUK ER FLOAT eller en BRUK IS DOBBEL data-element kan ikke inneholde noen av følgende bestemmelser BLANKEN NÅR NUL, RETTET, eller BILLEDE FLOAT eller DOBBEL-data-elementer kan ha en verdiklausul Verdien ma y være et flytende punkt bokstavelig, en numerisk bokstavelig ord eller ordet NULL Her er et eksempel på et data-element for arbeidsoppbevaring. Følgende kalles kollektivt datatypene C-stil SIGNED-INT, UNSIGNED-INT, SIGNED-SHORT , UNSIGNED-SHORT, SIGNED-LONG, UNSIGNED-LONG Disse datatyper ligner datatyper som finnes i C-programmeringsspråket. Databeskrivelsen for en C-type datatype kan ikke inneholde noen av følgende bestemmelser BLANK NÅR NUL, JUSTIFIED, eller PICTURE. Control-type er et av de grafiske kontrolltypenavnene som er kjent for kompilatoren, for eksempel LABEL eller ENTRY-FIELD, eller navnet på en ActiveX, COM, eller control. The databeskrivelsesoppføring for USAGE HANDLE-dataelementer kan ikke inneholde noen av de følgende klausulene BLANKEN NÅR NUL, RETTIGT, ELLER BILDE Hvis den inneholder en VALUE-klausul, må verdien som er angitt, være ordet NULL. Font-navn er en av følgende identifikatorer DEFAULT-FONT, FIXED-FONT, TRADITIONAL - FONT, SMALL-FONT, MEDIUM-FONT, LARGE-FONT. It bør bemerkes at enten - Df-alternativet eller - Cv-alternativet vil føre til at kompilatoren behandler COMP-1 og COMP-2 som FLOAT og DOUBLE. For mer informasjon, se avsnitt 5 4 i Overgang til ACUCOBOL-GT. Layout-navnet er navnet av en av systemets standardlayoutadministratorer. For øyeblikket kan dette bare være LM-RESIZE. A USAGE-setningen som er skrevet på et gruppnivå, gjelder for hvert elementarelement som er underordnet den gruppegjenstanden. Hvis ingen USAGE-setning er spesifisert, er USAGE IS DISPLAY underforstått. Det interne formatet til et USAGE IS DISPLAY-element er ASCII. Formatet på et indekselement er 32-bits signert binært. Dens størrelse er alltid fire, og den har en rekke verdier fra -2147483647 til 2147483647. Når du bruker en kompileringsbryter for kompatibilitet med versjoner før 6 0 0 - Z52 for eksempel er et indekselement 16-bits usignert binært, størrelsen er alltid to, og den inneholder verdier fra 0 til 65535. Formatet til et COMP-1-dataelement er 16-biters signert binær De juridiske verdiene spenner fra -32767 til 32767 Størrelsen på dataposten er alltid to bytes, og høyordenshalvdelen av dataene er lagret i venstre sidebyte. PICTURE-strengen som beskriver elementet, er irrelevant I motsetning til andre numeriske datatyper, oppstår en størrelsesfeil på COMP-1, COMP-X eller COMP - N data element bare når verdien overstiger den fysiske lagringen av elementet med andre ord, blir tallet 9 s i elementet s PICTURE ignorert når størrelsesfeil bestemmes. For COMP-2 desimal lagring lagres hvert siffer i en byte i desimalformat Hvis verdien er signert, tildeles en ekstra etterfølgende byte for tegnet. Lagringen av COMP-2 er identisk med BRUKSVISNING med fire rekkefølge på høy rekkefølge fra hver byte. For COMP-3-pakke-desimal lagring , to siffer lagres i hver byte. En ekstra halvbyte er allokert for tegnet, selv om verdien er usignert. Tegnet er plassert i høyre side og verdien er 0x0D for negativ. Alle andre verdier blir behandlet som positive, men se regel 18 nedenfor Størrelsen på et element, inkludert en for impl hvert tegn er delt med to for å komme fram til sin faktiske størrelse avrundingsfraksjoner opp. Formatet til et COMP-4-element er to s-komplement binært verdien uten dens desimalpunkt COMP-4-verdiene lagres i et maskinuavhengig format Dette formatet plasserer den høyeste rekkefølgen av verdien i venstre side og følger ned til lavordningsdelen i høyre stilling. Antallet byte som en datapost opptar avhenger av antall 9 s i bildet og på nærvær av ulike Kompileringstidsalternativer Du kan for eksempel bare inkludere mer enn atten 9 s hvis programmet ditt er kompilert for 31-sifret støtte Dette er oppsummert i følgende tabell. Merknad Når to verdier er gitt, gjelder den minste verdien for usignerte dataposter , og den største verdien gjelder for signerte dataelementer. P-5 brukes primært til å kommunisere med eksterne programmer som forventer innfødt datalagring. Formatet til et COMP-5 datapunkt er identisk med et COMP-4 dataelement, bortsett fra at dataene er lagret i en maskin-d ependent format Det lagres i en ordre som er naturlig for vertsmaskinen. For eksempel er et PIC S9 9 COMP-5 datapunkt tilsvarende et 32-biters binært ord på vertsmaskinen og en PIC S9 20 COMP-5-vare svarer til et 64-biters ord. Notat Data lagret i et COMP-5-felt kan ikke transporteres til andre maskiner fordi forskjellige maskiner har forskjellige naturlige bytebestillinger. På mange maskiner 68000 er de fleste RISC, COMP-5 identiske med COMP - 4 På andre 80x86, VAX, er det det samme med bytes i omvendt rekkefølge. En VALUE-klausul for en COMP-5 datapost lagres i et maskinuavhengig format og justeres når det lastes inn i dataposten. Dette sikrer at verdien er den samme fra maskin til maskin. På aritmetiske og ikke-aritmetiske butikker i COMP-5-elementer, hvis trunkering kreves, avkortes ACUCOBOL-GT som standard i desimaltall til antall siffer som er gitt i PICTURE-klausulen. Du kan bruke alternativet --TruncANSI-kompilatoren for å tvinge trunkering i binær til kapasiteten til allokering Oppbevaringen av COMP-5-elementer. - Dz og - noTrunc-alternativene påvirker også trunking. Se bok 1, avsnitt 2 1 9, Data Lagringsalternativer, for mer informasjon. Data 01 og 77 nivådata som COMP-5 synkroniseres automatisk til en passende maskingrense uavhengig av innstillingene for kompileringstid Dette tillater deg å sende disse elementene trygt til C-underrutiner uten å måtte bekymre deg med justering. Hvis COMP-5 brukes med et PIC X n-datapost og tilordnet en alfanumerisk verdi , resultatene er udefinerte. Følgende kodefragment forårsaker for eksempel NUM å ha et udefinert nummer, og den resulterende verdien for den siste linjen vil være 100. PIC X n dataelementet som brukes med COMP-5, kan ikke signeres. Formatet av en COMP-6-elementet er identisk med et COMP-3-element, bortsett fra at det er usignert og det ikke er plass til plass for tegnet. Hvis antall siffer er merkelig, legges null til venstre på nummeret før den er pakket. er to desimaltall per byte, og den faktiske størrelsen på Elementet bestemmes ved å dele sin PICTURE-størrelse med to og avrunding. En COMP-X datapost må beskrives med en bildestreng som består av kun 9 eller bare X-symboler. I begge tilfeller behandles dataposten som et usignert binært heltall , med intern lagring som ligner en COMP-4 datapost Hvis X-symboler brukes til å beskrive elementet, er antall byte som er tilordnet elementet det samme som antall X-symboler i bildestrengen hvis 9 symboler er brukes i stedet, da er antallet av byte som er tildelt, det minste antall byte som kreves for å holde et antall av den størrelsen. For eksempel vil en PIC 99-dataelement bli tildelt 1 byte, en PIC 9 9-datapost vil bli tildelt 4 byte. Uavhengig av Antallet 9 symboler i elementets bildestreng, den maksimale verdien som kan lagres i et COMP-X-element, bestemmes av antall byter som er tildelt det til maksimalt 18 siffer, eller maksimalt 31 siffer hvis 31 - digit-støtte er i kraft For eksempel, et COMP-X-element bestående av 1 b yte kan inneholde en rekke tall fra 0 til 255 En 2-byte COMP-X-nummer kan holde fra 0 til 65535 En størrelsesfeil oppstår kun på et COMP-X-objekt når verdien er større enn dataelementet kan holdes fysisk når COMP - X brukes med en PIC X-datapost, maksimumet er PIC X 8 Dette maksimalt økes til PIC X 16 når 31-sifret støtte er i kraft. En COMP-N-datapost er identisk med et COMP-X-datapost, bortsett fra at dataene er lagret i vertsmaskinens opprinnelige format, i stedet for maskinuavhengig format. Dataelementer som er beskrevet som PACKED-DECIMAL, er identiske med COMP-3. Du kan forårsake at unsigned PACKED-DECIMAL blir behandlet som COMP-6 ved å bruke et kompileringstid-alternativ. Som standard er et BINARY-dataelement identisk med en COMP-4-dataelement. Kompileringstid-alternativet - D5 behandler BINARY-dataelementer som COMP-5-elementer i stedet. I VAX-COBOL-kompatibilitetsmodus, er COMP-dataelementet er det samme som COMP-4 og behandles som binær data. I RM COBOL-kompatibilitetsmodus er COMP det samme som COMP-2. Du kan bruke kompileringstidsalternativer til cha nge standard oppførsel. En peker data element behandles som en usignert numerisk data element Det interne formatet er forskjellig for hver maskin Pointer data elementer er ment å holde adresser av andre data elementer se SET-setningen En peker data element kan ha en VALUE-klausul spesifisert for den, men den angitte verdien må være ordet NULL Dette indikerer at pekeren ikke peker på noen gjenstand Hvis en peker ikke eksplisitt er gitt en innledende verdi, er den opprinnelige verdien vilkårlig. Pointer-dataposter opptar 8 byte Dette gir nok plass til å holde en adresse på en 64-bits maskin Hvis du er på en mindre maskin, bruker kjøretiden bare de første 4 bytes pekerdataelementene de etterfølgende 4 byte forblir i minnet, de er bare ubrukt. Du kan bruke - Dw kompileringstid alternativ for å justere plass tildelt pekerdataposter Du kan gjøre dette for å spare lagring hvis du vet at du ikke kjører på en 64-bit maskin. Positiver kan brukes i betingede uttrykk, hvor de ca n bli sammenlignet med hverandre eller til verdien NULL En sammenligning som innebærer en peker må være enten lik eller ikke lik større og mindre enn sammenligninger er ikke tillatt. Nivå 01 og nivå 77 dataelementer som er POINTER-elementer synkroniseres automatisk til en passende maskin grense uavhengig av innstillingene for kompileringstid Dette tillater deg å sende disse elementene på en sikker måte til C-underrutiner uten å måtte bekymre seg for justering. Eksempel på automatisk synkronisering behandles dataelementer for USAGE POINTER i alle henseender som USAGE UNSIGNED-LONG dataelementer Dette håndterer alle aktuelle maskiner på riktig måte Denne virkemåten kan endres for å tilfredsstille kravene til en hvilken som helst fremtidig maskin. Oppblåsingspunktdataelementer lagres i maskinavhengig format. BRUK FLOAT-elementer har 4 byte som er tildelt dem. BRUK DOBBELLE gjenstander opptar 8 byte. Avstand 01 og nivå 77 dataposter som er USAGE FLOAT eller DOBBEL synkroniseres automatisk til passende maskingrenser uavhengig av kompileringstid innstillinger Dette tillater deg å sende disse elementene trygt til C subrutiner uten å måtte bekymre deg selv med justering. ANSI-definisjonen av COBOL angir ikke hvordan tegn skal lagres i numeriske felter, bortsett fra tilfelle av SIGN IS SEPARATE ACUCOBOL-GT lar deg velge Alternativ sign-storage-konvensjoner ved å bruke kompileringstid-alternativene - Dca, - Dcb, - Dci, - Dcm, - Dcn, - Dcr og - Dcv Angi en signallagringskonvensjon er noen ganger nyttig når du eksporterer og importerer data For ytterligere informasjon, se brukerhåndboken, kapittel 2 2 10, lagringsalternativer. Lagringskonvensjonen påvirker hvordan data vises i USAGE DISPLAY, COMP-2 og COMP-3 datatyper I BRUKERVISNING, standard ASCII-lagring, hvis tegnet er innlemmet i en sifferposisjon, er sifferet kodet i henhold til følgende tabell. Tabelloppføringer merket med en stjerne angir størrelser i fast størrelse En fast størrelse er like stor uavhengig av målmaskinen. Innføringer uten stjerne er variabel i størrelse Disse elementene vil oppta plass opptil antall byte som er oppført i tabellen. Merknad Størrelsene som er oppført i tabellen ovenfor dekker alle nåværende og forventede maskiner som kjører ACUCOBOL-GT. Fremtidige arkitekturer kan kreve endringer i maksimal størrelse som er tilordnet disse elementene. I utførelsesmiljøet virker disse elementene på alle måter som om de var datastørrelser av fast størrelse i den riktige størrelsen. For eksempel vil følgende kodefragment skrive ut 4 når det kjøres på en 32-bits maskin, men den vil skrive ut 8 når det kjøres på en 64-biters maskin. I de følgende eksemplene er hver byte representert ved to heksadesimale siffer eller med et enkelt sitert tegn. Hver verdi vises i de forskjellige formatene. Også vist er USAGE DISPLAY ved hjelp av de forskjellige SIGN-alternativene. Følgende eksempler bruker standard ACUCOBOL-GT-signallagerkonvensjonene. HANDLE-dataelementer utgjør sin egen dataklasse og kategori i COBOL Internt lagres de som heltallverdier og oppfører seg som tall når de brukes. En HANDLE-dataelement brukes vanligvis til å lagre håndtaket til et dynamisk opprettet objekt som et flytende vindu eller en grafisk kontroll. HANDLE-dataelementene kommer i to former skrevet og generisk Du lager et generisk håndtak når du slipper fra setningen Du lager et skrevet håndtak når du inkluderer OF-setningen . Du kan bare bruke HANDLE-dataelementer når det er eksplisitt tillatt, eller som en del av en MOVE-setning, en CALL-setning som en parameter eller i et boolesk uttrykk. Generelle håndtak kan brukes i alle situasjoner hvor håndtak er tillatt. Når du bruker en generisk håndtere som kilden til en MODIFY-setning, vil du ikke kunne bruke noen kontrollspesifikke egenskaper eller stilnavn i setningen. Dette skyldes at det generiske håndtaket kan være knyttet til hvilken som helst type kontroll. I dette tilfellet kan kompilatoren ikke bestemme hvilken sett med stil og eiendom navn er gyldig. Typed håndtak kan brukes i uttalelser der et håndtak er tillatt, eller når du refererer til et objekt av en tilsvarende type For eksempel kan en HANDLE OF WINDOW ikke brukes som håndtere i en DISPLAY LABEL-setning I stedet må du bruke enten et generisk håndtak eller et håndtak. Tastede håndtak gjør at kompilatoren kan gjenkjenne tilknyttede stil - og eiendomsnavn når det er aktuelt. Tykkede håndtak forbedrer også lesbarheten av programmet ved å gi ytterligere informasjon om det tiltenkte bruk av håndtaket, i tillegg til å gi kompileringstidskontroll for å sikre at du bruker håndtakene i passende situasjoner. Håndtak kan brukes i sammenligninger Det er bare to meningsfulle sammenligninger som kontrollerer likestilling eller ulikhet til NULL, og sammenligning med et annet håndtak datapost En håndteringsverdi av NULL indikerer alltid et ugyldig håndtak. Handler lagres internt som 4-byte binære heltall Denne informasjonen kan være nyttig når du feilsøker et program du kan undersøke verdiene til håndtakene i feilsøkeren. Du bør ikke stole på dette definisjon i programmet ditt, men fordi det kan bli endret i fremtiden. Handle dataelementene er automatisk SYNCHRO NIZED på en 4-byte grense Merk at dette skjer uavhengig av innstillingen for - Dl kompileringstid som begrenser mengden synkronisering. Runtidssystemet krever dette nivået for justering for å unngå å generere bussfeil på enkelte maskiner. Hvis skrifttypenavn er spesifisert, blir dataelementet beskrevet av USAGE-klausulen initialisert ved programoppstart med det tilsvarende skrifthåndtaket Dette virker identisk for å plassere setningen. at begynnelsen av programmet ditt, hvor dataelementet er dataposten beskrevet av USAGE-klausulen og skriftnavn er det samme som skriftnavn i USAGE-klausulen. Lesing av COBOL-layout. Denne veiledningen om hvordan du leser et COBOL-layout ble skrevet spesielt for våre kunder som har hatt en konvertering som ble utført på Disc Interchange, og har fått en COBOL-oppsett med dataene Det er ment å gi deg nok informasjon til å lese de enkleste oppsettene. Det dekker ikke alle emner eller alt du vil finne i et komplekst layout, og det er ment å forklare COBOL la youts bare slik at du kan bruke konverterte data, ikke slik at du kan skrive COBOL-programmer. Denne artikkelen starter her Lesing av COBOL-layouter der du også finner en emneliste. Part 4 Numeriske felt. Denne delen beskriver flere numeriske datatyper og håndtering av tegn og desimalpunkter. Innhold i denne delen. Brukes til å konvertere Numeriske felt Det er vår virksomhet. COBOL har flere typer numeriske felt. Disse datatyper inkluderer et DISPLAY-felt, som består av tegnene EBCDIC eller ASCII-tegn for 0-9, binære felt, pakkede felt og flytende punktfelt Det finnes også alternativer for et separat eller - tegn eller et tegn overpunch, og for ekte eller underforstått decimal. Datatypen er spesifisert av USAGE IS-klausulen. USAGE IS Clause. There er faktisk mer til bildeoversikten enn vi har tidligere beskrevet. Det er en USAGE IS-klausul som spesifiserer typen lagring av et numerisk felt - display, binær eller beregningsfull. Den fulle syntaksen, via et eksempel, er Dette sier til stor e feltet i computational-3 format Bruken er en del er valgfritt og vanligvis slått av, og beregningsavkortet kan forkortes COMP, slik at du vil se dette skriftligere. Typene numeriske felt du vanligvis vil se i COBOL-oppsett er. Display inkludert Signed fieldsputational eller compDisplay, inkludert Signed eller Zoned-felt, er den vanligste, og comp-3 er den nest vanligste typen numerisk felt. Noen kompilatorer kan også ha comp-4 og comp-5 datatyper, vanligvis til emulere comp på en annen compiler. Usage er Display. Display format er standard for tall i COBOL Hvis ingen bruk er klausul er angitt, er standard bruk er display, som betyr at verdien er lagret som EBCDIC tegn sifre, i motsetning til binære The verdien kan eller ikke ha en desimal - implisitt eller ekte - og kan være usignert eller ha et innebygd eller et separat skilt - som kan være enten ledende eller trailing. Det standard signerte skjermformatfeltet inneholder et innebygd bakteppe og er co mmonly kalt et signert eller IBM signert eller zoned-felt Denne datatypen er beskrevet nedenfor. Signed Fields. There er en vanlig numerisk datatype som brukes i COBOL på IBM mainframes kalles Signed også kalt IBM Signed, eller Zoned COBOL representerer denne typen felt av en S i bildeklausulen i et displayformatfelt, f. eks. PIC S9 6 Et signert felt består av vanlige EBCDIC numeriske tegn, ett tegn per byte, for alle tall unntatt den som har tegnet, enten det mest signifikante tegn ledende eller minst signifikante tegn etterfølgende siffer - vanligvis det minst signifikante sifferet Sifferet som holder tegnet kombinert, eller over stanser tegnet på tallet på det sifferet Dette sparer en byte som tegnet ellers ville okkudere Verdien av det sifferet lagres som en binær verdi, og er OR d med tegnkoden, som er D0 hex for negative tall, C0 hex for positive verdier, og F0 hex for usignerte verdier. På grunn av overpunchet vil sifferet som holder tegnet ikke vises som et tall når feltet vises i EBCDIC-tegnmodus Hvis du har feltet og viser en verdi på 1 23 med en EBCDIC-editor, vil den lese 0000012C. ASCII COBOL-kompilatorer bruker også en signert datatype med en overpunch, men tegnbitene er forskjellige og ikke standardisert mellom kompilatorer Se våre Tech-Talk kort signerte felter for ytterligere detaljer om både EBCDIC og ASCII Signed fields. Sign er Separate. COBOL signerte felt inkorporerer tegnet i verdien som standard se signerte felt over Men det er en bestemmelse i COBOL for et eget skilt, og det kan være enten ledende eller trailing. Erklæring for dette er Dette kan kombineres med ledende eller etterfølgende klausul Denne setningen kan brukes på et elementært elementfelt eller til hele recordputational og binære felt. Årsak datamaskiner utfører beregninger med binære tall, er det mer effektivt å lagre disse verdiene i filen i deres eget binære form enn å lagre dem i menneskelig lesbar base ti Hvis nummeret er lagret i sin natts Ive binært format kan det bli lagt inn fra filen og brukt direkte. Hvis det er lagret i et base ti format, må det konverteres til binært før du utfører beregninger på det, og konverteres deretter tilbake til base ti for lagring. COBOL definerer flere binære datatyper Vi vil se en kort oppsummering her, og du kan finne flere detaljer i COBOL Computational Fields og COBOL Comp-3 Packed Fields. Før vi starter, er det et viktig poeng å forstå. COBOL-standarden gir den faktiske implementeringen av de fleste datatyper opp til selgeren som skrev COBOL-kompilatoren Årsaken til dette er fordi ulike datamaskiner - CPUer - bruker forskjellige binære representasjoner internt og fungerer best med sin egen type binære tall. Denne tilnærmingen resulterer i bedre og raskere kompilatorer, men forårsaker også forvirring, fordi en kompdatatype på en maskin ikke nødvendigvis er den samme som på en annen maskin Tabellen under viser de vanlige bruksområdene, ikke alle kompilatorer vil følge disse typene For mer deta ils på ordrekkefølge og tegn se lenken ovenfor. Hvor datatype et felt bruker for lagring bestemmes av bruken er klausul i feltdefinisjonen, og i de fleste tilfeller er antall byte av lagring bestemt av antall siffer i PIC Flytepunktstall følger standard binære formater, og deres størrelse bestemmes derfor ikke av et PIC, og ingen PIC brukes i feltdefinisjonen. Beskrivelsen av hvordan denne datatypen er lagret. Packet desimal implementeres vanligvis som comp-3 Se komp -3. Når du leser en binær eller kompfeltespesifikasjon, er størrelsen som er oppført i PIC, antall desimaltall etter at nummeret er omgjort fra binært til basis ti. I tilfelle av et pakket felt er størrelsen etter utpakking. Real Decimal. Most PC-programmerere har en tendens til å tenke i form av ekteverdier i numeriske verdier På en PC, hvis du har et dollar - og cent-felt for, si, faktura totalt, i mengden 123 45, vil filen inneholde seks byte 123 45 og sannsynligvis et tegn Med andre ord er det et ekte desimalpunkt i filen COBOL kan også gjøre dette via følgende ELLER Tilstedeværelsen av i PICen forårsaker et ekte desimal i filen Implied decimal, men er mye mer vanlig i COBOL. Implied Decimal. Implied decimal betyr at det er et desimaltegn som er implisitt på et spesifisert sted i et felt, men ikke faktisk lagret i filen. Stedet for den implicitte desimaltall er angitt med en V i PIC. Bruk av implisitt desimal sparer plass i filen. Implied desimal kan gjelde for alle type numerisk felt, inkludert et pakket eller komp-3-felt. For eksempel er et underforstått desimalfelt Det er 6 siffer, deretter en underforstått desimal - V - og 2 flere siffer, for totalt 8 siffer Feltet er 8 byte i størrelse er det ingen i filen - plasseringen av desimaltegnet er antatt å være mellom 9 6 og 99 Hvis feltet inneholder 00000123, er kontosaldoen 1 23, fordi det er et desimal inneholdt mellom dollar og cent. Synkronisering og justering. Dette emnet er litt involvert for denne opplæringen, men du bør være oppmerksom på det. Når du bruker binær lagring binært og kompl, kan noen kompilatorer på enkelte maskiner kreve at et numerisk felt starter på en grense. For eksempel på en 32-bits maskin, kan det kreve at et kompfelt felt starter på en 32-biters grense. Hvis du angir et kompfelt felt midt i en plate, og det begynner ikke å begynne på en 32-biters 4 byte grense, vil kompilatoren justere den til en 32-biters grense for å synkronisere det Det som faktisk er lagret i filen, kan ikke være det samme som PICene på layouten indikerer. Dette er ikke et veldig vanlig problem, blant annet fordi binære og kompfelt felt ikke er veldig vanlige i filer, men du bør være oppmerksom på det. Informasjon. For flere artikler om datakonvertering, se vår TechTalk Index. Our COBOL Conversion Services. Disc Utveksling Service Company kan konvertere de fleste numeriske datatyper, inkludert alle IBM Mainframe EBCDIC datatyper, og de fleste ASCII datatyper fra PC og UNIX systemer Våre bibliotek av konve rsion rutiner tillater oss å håndtere de vanskelige jobbene som standard COBOL-kompilatorer ikke kan konvertere. En tilstand er et spesielt stykke kode som lar deg instruere datamaskinen til å sammenligne to deler av data. Betingelsene brukes i IF-setninger og i Mens inntil klausuler av PERFORM-setningen. Forholdene har syntaxen. Der data-1 og data 2 kan være en bokstavlig eller et feltdata-2, kan også være en COBOL-bokstav som SPACES eller ZEROS. Operator kan være de tradisjonelle sammenligningssymbolene. ulikhet bruk IKKE siden ikke alle kompilatorer godtar symbolet Sjarlig, en kompilator vil ikke akseptere Du kan bruke IKKE og IKKE Tilbake til Innholdsfortegnelsen. Statusene kan fortsettes over flere linjer uten å gjøre noe mer enn å plassere koden på separate linjer. Kompilatoren vil finne ut det. Meget lange alfanumeriske bokstaver kan fortsettes på flere linjer ved å plassere en bindestrek i kolonne 7 i fortsettelinjene og plassere resten av det bokstavelige der. Denne fortsettelsen av lite ral krever et begynnende enkelt sitat Det bokstavlige på den forrige linjen har ikke et sluttstående sitat, men anses å strekke til kolonne 72.Henfrekvensen på den andre linjen er i kolonne 7 Det enkelte sitat på linjen er i kolonne 12 og bokstavelig fortsetter derfra Det endelige sitatet på den linjen kreves Merk at delen av bokstavene som er på første linjen ikke har et sluttkvote Hvis den siste E ikke er i kolonne 72, antas det at alle tegnene mellom at E og kolonne 72 er mellomrom og vil dukke opp i det bokstavelige. Også gyldig med verdiklausuler. Kontrollbryter. Kontrollrapporter er en funksjon i rapporter som tillater gruppering og akkumulering av subtotaler for data som tilhører sammen basert på verdien av en feltet kontrollfeltet Når verdien for dette feltet endres fra en plate til en annen, bryter programmet for å gjøre spesiell behandling som utskriftsundertotaler før den fortsetter med neste rekord. Inngangsfilen må sorteres på c ontrol-feltet s. Et eksempel på en rapport med en kontrollnivå på én nivå. Kontrollbryteren er på avdelingen Hver kontrollgruppeavdeling har sine egne overskrifter og footings totals Selv om det ikke er vist her i dette eksemplet, er det vanlig for kolonneoverskrifter å gjentas etter hver kontroll overskrift. Se algoritmer siden for sample code. There er i utgangspunktet tre typer data gjenkjent av COBOL Numeric data både med eller uten desimaler bare 0-9, desimaltegnet og et tegn tillatt, alfabetisk bare tegn AZ og alfanumerisk noen tegn Alfabetisk brukes sjelden. Maten kan bare utføres på numeriske felt. Dater er vanlige data for COBOL-programmer og må manipuleres ofte Vanligvis lagres datoer i det gregorianske formatet, bestående av den kjente måneden, dagen og året Dette kalles vanligvis mmddyy-formatet, selv om mmddyyyy-formatet blir den nye standarden, se diskusjonssiden for Y2K. Mens disse formatene er kjent for kodene og brukerens datoer, er mor e lagres ofte i yymmdd eller yyyymmdd format slik at de enkelt kan sorteres. Den såkalte kalendermatematikken, hvor datoer brukes i beregninger, kan være en kjedelig prosess, med mindre kompilatoren støtter selve datafunksjonene. Hvis ikke, husk følgende om Den gregorianske kalenderen. April, juni, september og november har bare 30 dager. Februar har bare 28 dager, 29 hvis et springår. Alle andre måneder har 31 dager. Den offisielle metoden for å bestemme om et år er et sprangår krever at man deler 4-sifret år med 4, 100 og 400 og ser på remainders av de tre beregningene Hvis den første remiander er 0, er året et skuddår, men hvis den andre resten er 0, er året ikke et skuddår, men hvis den tredje resten er også en 0 så er året et springår igjen Dette er grunnen til at 2000 er et sprang år etter 1900 og 2100 er ikke Disse kontrollene må være nestet i hverandre, og prøver å sette dem i en enkelt IF vil ikke work. Delimiters brukes som visuelle ender til en uttalelse de gjør nt endre behandling, men de gjør kode enklere å lese og vedlikeholde. Et eksempel på en avgrenser er END-IF. Verbs som har sluttgrensere er sammenligningsvertenene IF, EVALUER, input output LES, SKRIV, DELET, REWRITE, ACCEPT, math ADD, SUBTRACT, MULTIPLY, DIVIDE, COMPUTE, bearbeiding overføring PERFORM, CALL og noen andre mindre brukte verbs. Når kompilatoren møter en periode det tar det som slutten av setningen En avgrenser som er funnet etter en periode er i feil. A feltet er hvilke andre språk som kaller en variabel Det er stedet å lagre data Alle felt må deklareres i DATA-avdelingen En feltdeklarasjon har tre deler nivånummeret feltet navn og PIC-klausulen VALUE klausuler er valgfrie. A gyldig feltnavn er fra 1 til 30 tegn i lengden inneholder bare bokstavene AZ, tallene 0-9 og bindestrek inneholder minst ett bokstav begynner ikke eller slutter med en bindestrek og er ikke et COBOL-reservert ord. Disse er spesielle numeriske bokstaver som er iboende med COBOL HIGH - VALUES er COBOL tilsvarer uendelig - ingen tall er større enn HØYVÆRDIER Omvendt er ikke noe tall mindre enn LAVVÆRDIER. Julian Dates. Julian er et datoformat som er et alternativ til gregorianske datoer. Det består av en 3-sifret dag og en år er det ingen måneder Dagene varierer fra 1. januar til 365 eller 366 31. desember, avhengig av om året er et springår eller ikke. Dette kalles vanligvis dddyy - eller dddyyyy-formatet, selv om det vanligvis er datoen lagret som yyddd eller yyyyddd for å lette med sortering. Butikker som bruker Julian datoer vil ha kallbare rutiner som skjuler Julian til Gregorian og tilbake igjen, fordi mennesker er komfortable med gregorianske datoer. Intrinsic date funksjoner tilgjengelig med nyere COBOL kompilatorer har disse konverteringene innebygd. Julian format has two advantages First, it s smaller, so it takes up less space Second, it eases with some calculations because it contains no months For example, how many days are between Feb 5, 1997 and Nov 28, 1999 Convert to Julian 19970 36 and 1999332 a quick subtraction gives 1026 days Remember that borrowing a year gives you 365 days. Getting a future date or past date can also be easier with Julian What date is 45 days before Apr 15, 1999 Convert it to Julian 1999105 , subtract 45 to get 1999060 and convert back to Gregorian Mar 1, 1999.Level Numbers. Level numbers are used to group fields in the Data Division A field can then be defined as a collection of other fields The higher the level number the lower in the heirarchy the field is Normally, the field numbers 01, 05, 10, etc are used By spacing them out you leave yourself room in case a level needs to be added later Valid level numbers are 0-49.Each FD is required to have an 01-level field defined This is the record definition It can be broken down into smaller fields if desired For example. We have an 01-level field that is broken down into 4 fields the 05-level fields Two of the 05-level fields are also broken down Employee number is an elementary field because it is not broken down into smaller fields The employee name and birth date are group level fields because they are broken down into smaller fields Only elementary fields have PIC clauses. The birth date is 8 characters long the sum of the lengths of the elementary fields that compose it All 8 characters can be accessed with one name IN-BIRTH-DATE or one of its pieces can be accessed by using that name instead i e IN-BIRTH-MM. A group level item ends when another field with the same level number, or one with a lower value, is encountered For example, the list of fields within IN-BIRTH-YEAR ends when the 05-level IN-DEPARTMENT is encountered A field of level 10 would also have ended it. All group level fields are considered to be alphanumeric. All of these level number concepts are valid for WORKING-STORAGE also. Literals are specific values as opposed to fields Alphanumeric literals are enclosed in single quotes In the following statements.3 1415927 is a numeric literal and Enter a number is an alphanumeric literal COBOL has some built-in literals like ZEROES and SPACES. A paragraph is a section of COBOL code Paragraph names start in the A margin and follow the same naming rules that fields do A paragraph ends when another paragraph name is encountered Paragraphs can be executed with the PERFORM statement. You can think of a pargraph as the equivalent of a subroutine in other languages There are no arguments, all fields are thought of as global. PIC Clauses. PIC short for PICture clauses describe the size and type of data for each field Numeric data has a PIC character of 9, alphanumeric data uses X and alphabetic data an A Each 9, X or A represents one character Length can also be represented by a repetition factor The PIC clauses 9999 and 9 04 both define 4-digit numbers. The PIC character V is used to mark where a decimal point is If you had a 8-digit numeric field but 2 of the digits are after the decimal point, you would define it as PIC 9 06 V99 The decimal point is impl ied, it is not physically there in the data It also takes up no space To allow for a field to hold either positive or negative numbers precede the leftmost PIC character with an S PIC S999V99.There are several output PIC characters which help with formatting data for display or print Numeric fields are MOVEd to fields defined with these formatting PIC characters Fields defined with these formatting PIC characters are considered alphanumeric No calculations can be done with these fields Newer versions of COBOL allow these fields to be MOVEd to straight numeric fields. To print a decimal point place a in the desired place in the output PIC clause i e PIC 999 99 You can place commas in output numbers also i e PIC 999,999 99 In this manner the decimal point and commas do take up space These are considered insertion characters - they insert themselves into the data Other insertion characters are B for a space , 0 a zero and useful in printing dates. There is Z, for suppressing leading zeroes If the digit represented by a Z is a leading zero it will print as a blank You normally have one 9 in the PIC clause, in the one s place All other digits represented by Z s Do not use Z s after the decimal point If used with commas i e PIC ZZZ, ZZ9 99 a comma will only print if the character to its left prints, else it prints as a blank. There are other zero suppression characters A can be used just like the Z except that rightmost leading zero will print as a and all zeroes to the left of that will print as spaces So the value of 125 00 MOVEd to a PIC , 9 99 will print as 125 00 This behavior of the is called floating An will work the same way for check protection but all print, not just the one to the left of the most significant digit When either the floating or the is used in conjunction with commas the comma will only print as a comma if the character to its left prints as a digit Depending on the situation it will otherwise print as a blank, or. For sign control you can use or - as an output PIC character A will print for positive numbers and - for negative numbers A - will print a - for negative numbers and a blank for positive numbers Either can be repeated to suppress leading zeroes like the and can float also like the Alternatively, a or - can be placed to the right of the number. For accounting purposes the PIC characters DB and CR can also be used i e PIC , 9 99DB The DB or CR will only show if the value is negative If positive they will print blanks. Qualified Fields. It is legal in COBOL for different fields to have the same name These fields cannot be 01-level fields and cannot be part of the same group-level field. When referencing one of these fields the compiler requires the field to be qualified, meaning its group-level field must be specified If both INPUT-RECORD and OUTPUT-RECORD contained a field named PAY-RATE then in code you cannot simply reference PAY-RATE, it would have to either be PAY-RATE OF INPUT-RECORD or PAY-RATE OF OUTPUT-RECORD. Reference Modification. Reference modification allows for the referencing of a portion of a field without having to make it a group-level field and defining each portion of the field that will be accessed. If you wanted to check the value of the 4th through 6th characters of a field to see if they were equal to ABC you can code. The first number in the parenthesis represents the start position in the field and the second number represents the length Both values have to be specified COBOL treats all such references as alphanumeric. Since this is not a self-documenting feature it should not be used carelessly. A report is simply a formatted representation of data, suitable for being printed on paper hardcopy Reports generically look like. The first two lines are page headings, which will appear on every page The next printed line following the blank line is column headings It s common for column heading lines to be printed on every page Next come the detail lines - typically one per record At the end of the report will be a total line if you are totalling anything Note that the first detail line is the 6th line printed on a page must count the blank lines also. There are other types of lines that can appear on reports Sometimes there are page footings printed on the bottom of each page There can also be report headings and report footings only printed at the top and bottom of the report as opposed to each page. Note the formatting of the data There are commas and leading zeroes are suppressed on page numbers and monetary figures The date has slashes Always make reports as easy to read as possible. See the algorithms page for sample code. A section is a group of paragraphs The section name must begin in the A margin and be followed by the word SECTION Naming standards for sections are the same as those for paragraphs A section ends when a new one begins. A section can be PERFORMed in the same manner a paragraph is PERFORMed The PERFORM only uses the section name, there is no reference to i t actually being a section instead of a paragraph. Subscripts and Indexes. Subscripts and indexes are the two tools used to reference individual elements of a table A subscript is a working-storage field defined separately from the table and is completely available to the programmer An index is created automatically by the system if it is directed to do so and only has limited availability to the programmer. An index cannot be part of a calculation, cannot be MOVEd to another field or cannot receive another field from a MOVE and it cannot be DISPLAYed To manipulate an index the SET statement must be used. The major difference between a subscript and an index is that a subscript is a position in the table first element, 20th element, etc An index is a byte offset of an element relative to the beginning of the table Since the first element is 0 bytes away from the start of the table, it has an index of 0 The 20th element say each element is a PIC X 5 starts 95 bytes from the start of the tab le so its index is 95 When manipulating an index the programmer does not do so by this byte offset It is done by position in the table and the translation to byte offset is done internally by COBOL. See the algorithms page for sample code on loading and searching tables. Tables are the COBOL equivalent to arrays It is a set of fields with the same name and the same data type To reference an individual element of the table a subscript or index must be used. Tables are defined using the OCCURS clause. See the algorithms page for sample code on loading and searching tables. Truncation is a phenomenon that occurs when the receiving field of a MOVE or a math operation is not big enough to hold what it s getting For alphanumeric fields truncation happens on the right move COBOL to a PIC X 4 and you get COBO and numeric it happens on the left move 1000005 to a PIC 9 06 and you get 5 No warnings, no messages Just the loss of data.77-level Fields. A working storage field can be declared with a level number of 77 The 77 must be in column 8, the field cannot be a group-level field and the field cannot be part of a group-level field.88-level Fields. A field declared with a level number of 88 is commonly known as a condition name This name can be used anywhere a condition can be used and is generally more readable Condition names are declared immediately after the field they are associated with They use no storage they take up no room. For example your application contains a field named ACCT-TYPE which is PIC 999 One particular section of code determines if the account is a checking account account type 100, 110, 210 or 300 , a savings account type 150 or 175 or a CD IRA type 400 An IF statement could look like. Logically accurate but not entirely clear what account types are what Comments would help, but condition names will help more Define as. The same IF can now look like. Now it s self-documenting The added advantage is if another type of savings account is developed it only needs add ed at the condition name The IF statement doesn t change. A specific value can appear in multiple condition names Values associated with a condition name can be specified with THRU i e VALUES 90 THRU 99 When checking condition names NOT can be used If a condition name only has one value a statement such as SET CD-IRA-ACCT TO TRUE is valid and is the equivalent to MOVE 400 TO WS-ACCT-TYPE. The ACCEPT statement is used to get information from a source other than a data file like the keyboard or CPU clock. will cause the program to wait until the enter key is pressed Any data typed in before the enter key is pressed will then be placed in field See How do I for issues with getting numeric data in this manner See the algorithms page for sample code on receiving and processing data received interactively. The ACCEPT statement can also be used to get information from the system clock such as the current date and time. field-1 is PIC 9 6 The date will be in yymmdd format. field-2 is PIC 9 8 The tim e will be in hhmmsscc format where cc is hundredths of a second hh will be in military time 0-23.field-3 is PIC 9 3 The value will represent the current Julian date, which is a number from 1-366 representing the date as a number of days relative to the end of the previous year Jan 1st 1, Feb 1st 32, etc. field-4 is PIC 9 The values range from 1 Monday to 7 Sunday. The basic form of the ADD statement is. which adds value either a literal or a field to field-1 and stores the result in field-1 A list of fields can follow the TO which will add the value to each of them A list of values can be before the TO which would add all of them to field-1.It is possible to add two values either literals or fields and store the result in a separate field with the GIVING clause. Blank When Zero. BLANK WHEN ZERO can be specified with a PIC clause so that blanks are printed if the value of the field is zero For example, PIC -,--9 99 BLANK WHEN ZERO. The CALL statement is used to call another program As long as the called program contains a GOBACK or EXIT PROGRAM then when the called program finishes control returns to the calling program. Fields can be passed from the calling program to the called program These fields are in the calling program s WORKING-STORAGE SECTION and in the called program s LINKAGE SECTION The USING clause on the CALL specifies the fields to pass The called program lists these fields in the USING clause of the PROCEDURE DIVISION These fields don t have to have the same name in both programs, but the definitions must match. See the algorithms page for sample code on calling another program. The CLOSE statement will close an open file Attempting to close a closed file will produce a run-time error. One CLOSE statement can close multiple filesPUTE allows you to c ombine several math operations in one statement, using familiar symbols instead of English-like sentances. Expression is any valid mathematical expression involving literals fields and the following symbols COBOL has no recursion. Each of the examples can also be specified with a THRU option, allowing for a sequence of paragraphs to be executed. Paragraph-name-2 will also be executed. There is also what s known as an in-line perform where a block of code appears between a PERFORM and END-PERFORM No paragraph name is specified For example. When using the UNTIL option with a perform or in-line perform the UNTIL condition clause can be preceded by WITH TEST AFTER to have COBOL check the condition after the loop instead of before This will cause the loop to always be executed at least once This has the effect of a REPEAT-UNTIL loop of other languages. The read statement will read the next record from the specified file and place the data in the record layout of that file s FD The file must be al ready open as input Reading an unopend file or attempting to read beyond the end of a file will produce a run-time error The AT END clause is required. Optional clauses are NOT AT END and INTO NOT AT END specifies a statement to be executed if the read did not hit the end of the file INTO specifies a working-storage field into which the system will place the input record. The READ NEXT is used after a successful START to read records along the established access path The condition used by the START is not remembered by the READ NEXT so after each successful READ NEXT the record must be checked to see if it still matches whatever criteria the program is calling for A successful read only means that a record was retrieved. Since this is still a sequential process the READ NEXT requires an AT END clause The optional NOT AT END clause is supported. See the algortihms page for code examples. The REDEFINES clause allows you to have multiple field definitions for the same piece of storage The same data then can be referenced in multiple ways. Take a simple example, useful for data validation. This portion of the data division only consumes 8 bytes of storage, not 16 Each of the two PIC clauses is describing the same 8 bytes of data, just doing it differently. Once data is in WS-NUMBER-X it can be checked to see if it is numeric IF WS-NUMBER-X IS NUMERIC If so, WS-NUMBER can then be used as part of a calculation If the data happens to be non-numeric then this type of code will prevent the program from choking We access the data as alphanumeric any data allowed to see if it is safe to access it as numeric before actually attempting to do so. Note that once the data was moved to WS-NUMBER-X it was also moved to WS-NUMBER because they both describe the same portion of storage. There are a few rules with REDEFINES. A redefinition must have the same level number as the field it is redefining. The redefinition must immediately follow the field it is redefining i e if an 05-level field is bei ng redefined then the redefinition must be the next 05-level field. Cannot have a REDEFINES of an 01-level field in an FD. The redefinition should be the same size as the field it is redefining though not all compilers require this. It is possible to redefine at the group level though each group-level field does not have to the same number of elementary fields. Not all compilers allow VALUE with REDEFINES It s a bad idea in any case. Can have multiple REDEFINES of the same field. Back to Table of Contents. The RELEASE statment is required in an INPUT PROCEDURE of a SORT It is used to specify that a record is to be included in the sort. Only RELEASEd records will be sorted. See the algorithms page for sample code on using the SORT statement. The RETURN statment is required in an OUTPUT PROCEDURE of a SORT It is used to retrieve a record from the sort back into your program. The records are RETURNed in the sorted order. Like the READ statement the RETURN supports the NOT AT END and INTO optional cla uses Also like the READ, it is best if only one statement is used in either the AT END or NOT AT END clauses. See the algorithms page for sample code on the SORT statement. REWRITE will update the current record in a non-sequential file OPENed as I-O There must be a current record, so a successful READ or READ NEXT must precede the REWRITE Following the READ READ NEXT and before the REWRITE some information on the record will presumably be changed. REWRITE specifies the record, not the file. See the algorithms page for sample code on using non-sequential files. Rounded is a clause valid with any of the math verbs ADD SUBTRACT MULTIPLY DIVIDE COMPUTE Place it in the command after the name of the field that will receive the result. The search command is used to search a table for a particular entry The table must have an index see OCCURS The format is. The field is the field with the OCCURS clause WHEN specifies the condition on which to end the search usually when some field equals a table ent ry Only one statement can be specified in the WHEN but it can be a PERFORM The AT END clause is optional, specifying one statement to be executed if the entire table is searched without satisfying the WHEN condition It is recommended, however. There can be multiple WHENs but the search stops once the condition of a WHEN is satisfied To allow for multiple search matches use a PERFORM VARYING which can increment an index. If the table entries are sequenced by the field being searched then a binary search can be used instead Use SEARCH ALL instead of SEARCH It is more efficient than a regular search, especially with large tables The SEARCH ALL has some limitations. Only one WHEN is permitted. The WHEN condition can only test equality. The WHEN condition cannot contain an OR. The table field must be to the left of the in the condition. See the algorithms page for sample code on loading and searching tables. Set can be used to manipulate an index. Note that while an index is actually a byte offset w ithin a table COBOL does not expect you to work on that level Setting an index to 2 will cause it to point to the 2nd element in the table, regardless of its offset Likewise, seting an index up one will move it to the next element in the table, regardless of the size of the element COBOL will translate it to the proper offset for you. Set can also be used with condition names as an alternative to a MOVE Consider the following. It is then permissible to code. This is the equivalent to MOVE Y TO WS-END-OF-FILE-SW but it is more readable Most compilers will not allow a condition name with multiple values to be used in a SET It is not a good idea in any case. The sort statement is used to sort a file It requires a work file area that is defined in the FILE SECTION, just like any other file, except it is an SD instead of an FD The basic sort statement looks like. Multiple fields can be used in the sort, just list them in the desired order DESCENDING KEY can be specified instead of ASCENDING KEY DESCENDING KEY and ASCENDING KEY can be combined in the same statement. The SORT statement will open and close both the input and output files automatically The field s to be sorted on must be defined in the SD of the sort file. An INPUT PROCEDURE can be specified instead of an input file This allows the flexibility of selecting specific records to be sorted or to do other types of processing before the sort Likewise, an OUTPUT PROCEDURE can be used instead of an output file An INPUT PROCEDURE requires a RELEASE statement and an OUTPUT PROCEDURE requires a RETURN statement For example. This statement will execute paragraph-1 perform the sort and then execute paragraph-2 An INPUT PROCEDURE can be used with GIVING and an OUTPUT PROCEDURE can be used with USING Each of these options allows the THRU option i e paragraph-a THRU paragraph-b. The clause WITH DUPLICATES IN ORDER can be included in the statement after the last ASCENDING DESCENDING KEY This will cause any records with the same value s for the sort field s to be kept in their original order Not specifying this will not necessarily change their original order, but there is no guarantee. See the algorithms page for sample code on using the SORT statement. The Start statement is used to establish an access path for an indexed file with alternate keys see the algortihms page for code examples Note that keys in alternate indexes are not necessarily unique and the START is used in conjunction with the READ NEXT statement to find and retrieve and these records. The alternate key field must already be populated with a value. The first record in the file with that value for the alternate key is read It is a good idea to include a INVALID KEY clause in any START to handle the case where there is no record in the file with the appropriate alternate key. Instead of EQUALS the START also supports and NOT or NOT Back to Table of Contents. The stop run statement will cause a normal termination to your program. The STRING is used to con catenate join multiple fields or literals into one field It replaces a series of MOVEs For example. After the above statement is executed WS-DISPLAY-DATE will contain 12 24 2000 DELIMITED BY SPACE means to use as much of that field or literal that appears before the first space If there are no spaces like in the example then the entire field or literal is used Any character can be used in the DELIMITED BY clause. Literals are usually DELIMTED BY SIZE, meaning to use the whole thing. The DELIMITED BY character is never included in the combined field. The basic form of the subtract statement is. which subtracts value either a literal or a field from field-1 and stores the result in field-1 A list of fields can follow the FROM which will subtract the value from each of them A list of values can be before the FROM which would subtract all of them from field-1.It is possible to store the result in a separate field with the GIVING clause. The UNSTRING is used to split a field into multiple fields using a particular character to determine where to split the field For example. The above statement will take the all of WHOLE-NAME, up to but not including the 1st space, and place it into WS-FIRST The the part that is between the 1st and 2nd spaces, not including either one, is placed in WS-MIDDLE, and so on. USAGE can be used in conjunction with the PIC clause to specify how numeric data is to be stored The most common options are DISPLAY the default , COMP and COMP-3 COMP is short for COMPUTATIONAL, which can also be used The words USAGE IS are optional USAGE is only valid with numeric fields It can be specified as follows. A number stored as COMP is in binary format A COMP-3 number is stored as packed-decimal. The USING clause is used to pass parameters from one program to another It appears in the Call statement of the calling program to specify the parameter list These parameters must be working storage fields. The called program must have a USING clause on its PROCEDURE DIVISION sta tement followed by the parameters the program is receiving These fields are defined in the LINKAGE SECTION of the DATA DIVISION, which follows the WORKING-STORAGE SECTION All of the received fields are updateable by the called program. The parameters do not have to have the same names in the calling and called programs but the sizes and data types have to match. See the algorithms page for sample code on calling one program from another. Value allows you to initialize a field at the same time it is defined The VALUE clause follows the PIC clause and must be the proper type of data The value can be changed in code at any time. Some compilers will require the VALUE data to be the proper size also, others will truncate to fit Most compilers will not allow VALUEs in input FDs - it is a bad idea in any case. The write statement will write data to the specified file The file must be opened for output Attempting to write to an unopened file or a file opened for input will produce a run-time error. Optional clauses are FROM, BEFORE and AFTER FROM specifies a working-storage field from which the system will select the data that is to be written FROM can appear with either BEFORE or AFTER. BEFORE and AFTER specify actions to be taken by the printer along with writing a record of data You can either specify the number of lines that are to be advanced or you can specify advancing to the top of the next page BEFORE and AFTER cannot appear in the same write. This document will focus on a discussion of a numeric field or data string known as PACKED-DECIMAL format also referred to as packed data or a packed numeric field This format is used on an IBM Mainframe System and is supported by Micro Focus COBOL running on a Linux, UNIX or Windows System. Note The items in this document are appropriate for applications that are written in COBOL, Mainframe Assembler HLASM or PL I The IBM Mainframe architecture drove many of the numeric formats that existed in the early ANSI specifications for COBOL and have been carried forward to the current COBOL ANSI specifications. A packed decimal representation stores two decimal digits in one byte A packed decimal representation stores decimal digits in each nibble of a byte a byte is eight bits and a nibble is four bits Each byte has two nibbles, and each nibble is indicated by a hexadecimal digit For example, the value 23 would be stored in two nibbles, using the hexadecimal digits 2 and 3 the bit representation would be 0010 0011 The sign indication is dependent on your operating environment On an IBM mainframe, the sign is indicated by the last nibble of the last byte or high memory address For explicitly signed fields the C indicates a positive value and D indicates a negative value For unsigned or implied positive fields the F indicates a positive value. The mainframe can perform arithmetic functions on packed-decimal fields without having to convert the format Storing numeric values in a packed-decimal format may save a significant am ount of storage space For example, on the mainframe the value 12,345 would be five 5 bytes in length i e x F1F2F3F4F5 If the same information is stored in a packed-decimal i e USAGE IS COMPUTATIONAL-3 or abbreviated as COMP-3 the field would be three 3 bytes in length i e x 12345C. When converting records or data structures that contain this type of field from EBCDIC to ASCII the programmer is presented with a number of confusing options and challenges This document will try to explain the options and help the programmer avoid the common mistakes that are made during a conversion process. The following table shows the structure of a five digit numeric field using the Packed-Decimal format i e the COBOL syntax would be USAGE IS COMP-3 The field contains a value of one-hundred-twenty-three or 00123 Since the packed-decimal format stores a digit in each nibble 2 digits per byte the actual field size is only three 3 bytes. The Packed Decimal Format for a Numeric Field. Note-1 A field that is d efined as Unsigned i e PIC 99999 COMP-3 is an implied positive value Note-2 The Hex is an abbreviation for Hexadecimal notation Note-3 A field that is defined as Signed i e PIC S99999 COMP-3 will have the sign in the rightmost nibble of the units positions or Byte-2 in the preceding example A X nC is used as an explicit positive sign and a X nD is used as an explicit negative sign Note-4 The Packed-decimal format is the same for the Mainframe and for Micro Focus running on a Windows or UNIX system. We have made a significant effort to ensure the documents and software technologies are correct and accurate We reserve the right to make changes without notice at any time The function delivered in this version is based upon the enhancement requests from a specific group of users The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources. Copyright 1987-2017 SimoTime Technologies All Rights Reserved. Table, Packed-Decimal Field S izes. The following is a table that shows the actual field sizes for a COMP-3 or packed-decimal based on the number of digits specified in the picture clause. Convert Packed-Decimal to Text. This section describes how to convert the previously discussed packed-decimal formats into text strings to print or display the information in a human readable form Before converting the packed-decimal fields it should be determined if a conversion is necessary The following list provides some basic guidelines. When migrating an application both data and COBOL programs for processing the data from an IBM Mainframe System to a Windows System with Micro Focus Enterprise Server a conversion of the Packed-Decimal fields is not necessary Micro Focus COBOL supports the packed-decimal format. When migrating an application both data and COBOL programs for processing the data from an IBM Mainframe System to a Linux or UNIX System with Micro Focus Enterprise Server a conversion of the Packed-Decimal fields is not necessary Micro Focus COBOL supports the packed-decimal format. When migrating or transferring data from a COBOL oriented, IBM Mainframe or AS 400 environment to a non-COBOL oriented Linux, UNIX or Windows environment i e ASCII Text or excel spreadsheet then a conversion will be required This may require two conversion tasks The packed-decimal fields or data strings will need to be converted to a zoned-decimal format sign leading separate with an explicit decimal point should be considered depending on the target environment The zoned-decimal format may then require a conversion from EBCDIC to ASCII. When using the File Transfer Protocol FTP to transfer a data file between a Mainframe System and a Linux, UNIX or Windows System it will be necessary to use the BINARY mode if the records contain packed-decimal fields If a conversion between EBCDIC and ASCII is required it will need to be done after the file transfer. Convert to Text with Explicit Sign. This section describes how to convert a packed-decimal field i e PIC S9 5 USAGE IS COMPUTATIONAL-3 to a zoned-decimal field i e PIC S9 5 USAGE IS DISPLAY SIGN LEADING SEPARATE The resulting field will have a separate leading sign but will still have an implied decimal based on the field definition from the COBOL picture clause. Convert to Text with Explicit Decimal. This section describes how to convert a packed-decimal field i e PIC S9 5 USAGE IS COMPUTATIONAL-3 to a zoned-decimal field i e PIC X The resulting field will have a separate leading sign and an explicit decimal point embedded in the text string This field or data string may easily be exported to a non-COBOL environment. Spaces in a Packed Field. We have seen a few instances where a packed field may contain SPACES This should be considered a bad programming practice Having non-numeric values in a numeric field should be avoided The process that caused non-numeric values to be placed in a numeric field should be corrected When converting data between EBCDIC and ASCII this presents an additional effort to deal with the situation. A SPACE character hex 40 for EBCDIC or a hex 20 for ASCII could be a valid numeric entry in a packed field in all the positions of the field except the units positions It would be reasonable to assume that if the units position of a packed field is a SPACE character and all other positions are SPACE characters then the packed field SPACE values should be converted between EBCDIC and ASCII. For numeric fields with USAGE IS COMP-3 i e PACKED FIELDS the conversion code generated by SimoTime does not do any conversion This is the default behavior However, since the situation does exist the SimoTime technology has a configuration option to generate conversion code that will analyze a packed field and convert SPACE values between EBCDIC and ASCII or to initialize the packed field with a ZERO value. The following is sample code that will test a packed field for SPACE values and then convert the EBCDIC SPACE values to ASCII SPACE val ues. The following is sample code that will test a packed field for SPACE values and then initialize the packed field to ZERO values. When trying to do an arithmetic operation on a packed field that has a non-numeric value or an invalid sign the operation will ABEND with a S0C7 Program check on the Mainframe System The operation will ABEND with a 163 RTS error on a Micro Focus System. This condition is managed on the EBCDIC-encoded Mainframe System by using the NUMPROC NOPFD compiler option that accepts the invalid sign and treats space characters x 40 as zeroes This approach does not fix the problem, it simply tolerates the condition while presenting additional challenges for the data conversion and validation efforts. For files that contain records with packed or binary fields the EBCDIC to ASCII data conversion is done at the field level Since the packed and binary fields have their unique bit structure i e neither EBCDIC nor ASCII they are left in their existing structure Therefore, a packed field that contains all x 40 characters will contains all x 40 characters after the record is converted. Herein lies the challenge, the x 40 character is a space character on the EBCDIC-encoded Mainframe System but it is not a space character in an ASCII-configured environment. In an ASCII-configured Micro Focus environment the spaces in a numeric, packed field can be managed by using the SIGN-FIXUP compiler directive This directive provides limited emulation of NUMPROC NOPFD when used with HOSTNUMMOVE HOSTNUMCOMPARE. However, since the x 40 value is not a space character in the ASCII environment and is a valid numeric value in a packed field it will produce incorrect totals when used in an arithmetic operation Therefore, at a minimum the x 40 values will need to be changed to an ASCII space or x 20 character. Note the process that causes the packed fields to contain SPACE characters should be addressed The Compiler options only prevent the ABEND but may produce incorrect results wh en used in arithmetic processing. The following link will provide more details about compiler directives and numeric field processing. Explore the Compiler Directives available for the Micro Focus COBOL technologies. Explore how to process non-Numeric Values stored in a Packed-Decimal format This document will use examples to show how to manage a situation where non-numeric values such as Space Characters are placed in a Packed-Decimal field and then managed to avoid a S0C7 or RTS 163 error message and an abnormal termination of the program. The purpose of this document is to provide an overview of numeric data strings or fields that are packed-decimal format This document may be used as a tutorial for new programmers or as a quick reference for experienced programmers. In the world of programming there are many ways to solve a problem This document and the links to other documents are intended to provide a greater awareness of the Data Management and Application Processing alternatives. The documentation and software were developed and tested on systems that are configured for a SimoTime environment based on the hardware, operating systems, user requirements and security requirements Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration. SimoTime Services has experience in moving or sharing data or application processing across a variety of systems For additional information about SimoTime Services or Technologies please send an e-mail to or call 415 883-6565 We appreciate hearing from you. Software Agreement and Disclaimer. Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the Simo Time copyright notice appear on all copies of the software The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies. SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose It is provided AS IS without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material. Downloads Links. This section includes links to documents with additional information that are beyond the scope and purpose of this document The fir st sub-section requires an internet connection, the second sub-section references locally available documents. Note A SimoTime License is required for the items to be made available on a local server. Current Server or Internet Access. The following links may be to the current server or to the Internet. Note The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the icon If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the icon. Explore how to process non-Numeric Values stored in a Packed-Decimal format This document will use examples to show how to manage a situation where non-numeric values such as Space Characters are placed in a Packed-Decimal field and then managed to avoid a S0C7 or RTS 163 error message and an abnormal termination of the program. Explore how to Calculate a Record Count and Accumulate Summary Totals by reading a Record Sequ ential Data File Each record contains numeric fields with a packed-decimal COMP-3 format The count and totals will be posted to the SYSOUT device. Explore The Binary or COMP format for numeric data strings This numeric structure is supported by COBOL and may be explicitly defined with the USAGE IS COMP or USAGE IS BINARY clause. Explore The Edited for Display format for numeric data strings This numeric structure is supported by COBOL and may be used with an edit-mask to prepare the presentation for readability by human beings. Explore The Packed-Decimal or COMP-3 format for numeric data strings This numeric structure is supported by COBOL and may be explicitly defined with the USAGE IS COMP-3 clause. Explore The Zoned-Decimal format for numeric data strings This numeric structure is the default numeric for COBOL and may be explicitly defined with the USAGE IS DISPLAY clause. Explore commonly used formats and processing techniques for managing various numeric formats available on the mainfr ame. Explore the Numbers Connection for additional information about the structure and processing of numeric data items or numeric fields. Explore the Compiler Directives available for the Micro Focus COBOL technologies. Explore How to Generate a Data File Convert Program using simple specification statements in a Process Control File PCF This link to the User Guide includes the information necessary to create a Process Control File and generate the COBOL programs that will do the actual data file conversion The User Guide contains a list of the PCF statements that are used for the data file convert process. Explore How to Generate a Data File Compare, Validate or Hex-Dump Program using simple specification statements in a Process Control File PCF This link to the User Guide includes the information necessary to create a Process Control File and generate the COBOL programs that will do a data file compare, accumulate summary totals with a record count or produce a Hex-Dump of records in a VSAM, KSDS based on a list of user-defined keys The User Guide contains a list of the PCF statements that are used for the data file compare, validate or dump process. Explore a typical data file conversion process that may be required when working in a multi-system environment This suite of documents describes a model for managing non-relational data structures Sequential Files and VSAM Data Sets that contain ASCII or EBCDIC text strings and various numeric formats such as BINARY, PACKED-Decimal and ZONED-Decimal This model has the capability of creating a test file for an ASCII or EBCDIC encoded environment This suite of documents will address many of the challenges of doing a record content conversion of a file that will be transferred between an EBCDIC-encoded Mainframe System and an ASCII-encoded Linux, UNIX or Windows System. Explore The ASCII and EBCDIC Translation Tables These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats. Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and or QSAM files. Internet Access Required. The following links will require an internet connect. A good place to start is The SimoTime Home Page for access to white papers, program examples and product information This link requires an Internet Connection. Explore The Micro Focus Web Site for more information about products and services available from Micro Focus This link requires an Internet Connection. Glossary of Terms. Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papersments or Feedback. This document was created and is copyrighted and maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please call or send an e-mail to. We appreciate hearing from youpany Overview. SimoTime Technologies was founded in 1987 and is a privately owned company We specialize in the creation and deployment of business applications using new or existing technologies and services We have a team of individuals that understand the broad range of technologies being used in today s environments Our customers include small businesses using Internet technologies to corporations using very large mainframe systems. Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms. Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process SimoTime has the technology, servi ces and experience to assist in the application and data management tasks involved with doing business in a multi-system environment. Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at. Packed-Decimal Format, Description and Discussion. Note 1 A binary field that is defined as Unsigned i e PIC 999 is an implied positive value A two 2 byte unsigned, binary field may contain a range of implied positive values from 0 to 65,535.Note 2 A binary field that is defined as Signed i e PIC S999 will use the high-order, leftmost bit as the sign A zero 0 is a positive sign and a one 1 is a negative sign A two 2 byte signed, binary field may contain a range of values from -32,767 to 32,767.The BINARY Format for a Numeric Field. We have made a significant effort to ensure the documents and software technologies are correct and accurate We reserve the right to make changes without n otice at any time The function delivered in this version is based upon the enhancement requests from a specific group of users The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources. Copyright 1987-2017 SimoTime Technologies All Rights Reserved. The Idiosyncrasies of COMP Fields. The creation and processing of COMP or BINARY data on a Windows or UNIX platform must be done in the same manner as the mainframe On the mainframe COMP or BINARY fields must be 2, 4, or 8 bytes in length the mainframe was originally a half-word, full-word and double-word centric system On Linux, UNIX or Windows using Micro Focus COBOL with Net Express or Server Express the COMP or BINARY fields may be 1 through 8 bytes in length. Note The syntax for COBOL is USAGE IS COMPUTATIONAL However, this is usually abbreviated to COMP or may be coded as BINARY. Notice the following, the record layout for the Item Master File contains two 2 COMP or BINARY fi elds These fields are defined as PIC 9 7 and may contain values from zero 0 through 9,999,999 or the binary values of x 000000 through x 98967F which may be contained in a three 3 byte binary field. Herein is the problem, on the EBCDIC-encoded, half-word, full-word, double-word, mainframe environment the fields would be allocated with an actual length of four 4 bytes for a binary field For the Micro Focus, ASCII-encoded, byte-oriented environment the fields would be allocated with an actual length of three 3 bytes for a binary field. The solution to this problem for the Micro Focus environment is to use the IBMCOMP and NOTRUNC directives when compiling the programs This will enforce the mainframe rules for COMP or BINARY fields and the field lengths will be the same as the mainframe. An alternative solution is to modify the copy file and change the PIC 9 7 to PIC 9 9 However, this solution requires a source code change and is not recommended during the first phase of a data migration. Nume ric Field Definitions Lengths. The following table shows the COBOL picture clause, the number of digits, the length of a packed field, the length of a binary COMP field for an IBM Mainframe and the length of a binary field for the Linux, UNIX and Windows LUW environments running Micro Focus COBOL. The differences in field or data string length are high-lighted in RED. It is important to note that Micro Focus Mainframe Express supports the mainframe format for binary or COMP fields This is accomplished by pre-setting the compiler directives to force this behavior The compiler directives are IBMCOMP and NOTRUNC These directives may also be used with Net Express and must be configured manually since the default for Net Express is to allow binary fields to be any length. Big Endian Little Endian. Information is usually process by executing programs that were created using a program language that separates the user programmer from the underlying hardware structure However, this separation is not one-hundred percent Therefore, some level of awareness or understanding of the hardware may be required The hardware techniques used to define, process, save and retrieve numeric values is typically an area where some level of understanding is required. First, lets review how units of information are structured in a typical computer system. A bit is a unit of information A bit may be in an OFF or ON condition that is traditionally referred to as 0 or 1 Four 4 bits make a nybble and eight bits or 2 nybbles make a byte. Note The term nibble is commonly used but the original spelling was nybble. Next, lets review how units of information are stored in memory and processed by the system. In order to understand the concept of Big and Little Endian we need to understand memory typically referred to as RAM or Random Access Memory We may think of RAM as one large array with many one-byte elements An Index is typically used to access a specific element within an array An Address is typically used t o access a specific location within RAM or memory. Note For this discussion we are using a RAM architecture that stores one byte in each RAM location There are some RAM architectures where each memory location stores something besides a byte However, these are rare so we will limit this discussion to RAM architectures that are byte oriented. An IBM Mainframe System has the hardware capability of performing arithmetic tasks using a variety of different formats Since we are currently focused on a discussion of Big and Little Endian formats we will limit this discussion to 32 bit or 4 byte integers For COBOL programmers this would be USAGE IS COMPUTATIONAL. The question, How are these 4 bytes placed in RAM for processing. The answer, It depends, The IBM Mainframe System uses Big Endian and the hardware that is used to run Linux, UNIX and Windows typically use Little Endian It would be important to note that Micro Focus COBOL has a compiler directives IBMCOMP that provides support for the Big Endian support for COMP fields. The following shows how the 4 bytes of a 32 bit integer are arranged in RAM starting at an address location of 100.Note Notice the bytes of the little endian are in the reverse order when compared to big endian format With little endian the least significant byte is stored first With big endian the most significant byte is stored first. Next, lets review how data files are used to save and retrieve units of information. To understand the importance of endianness lets take a look at the following example. A data string of x 1A2B3C4D is written to a file on a system that uses big endian. This is hexadecimal notation of four bytes 1A, 2B, 3C and 4D or 32 bits 0001 1010 0010 1011 0011 1100 0100 1101.On a Little Endian System this would represent a decimal numeric value of 1,295,788,826.Attention This would result in a difference of 856,747,725 between the expected value and the actual value. The purpose of this document is to provide an overview of binary formats for numeric data strings or fields This document may be used as a tutorial for new programmers or as a quick reference for experienced programmers. In the world of programming there are many ways to solve a problem This document and the links to other documents are intended to provide a greater awareness of the Data Management and Application Processing alternatives. The documentation and software were developed and tested on systems that are configured for a SimoTime environment based on the hardware, operating systems, user requirements and security requirements Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration. SimoTime Services has experience in moving or sharing data or application processing across a variety of systems For additional information about SimoTime Services or Technologies please send an e-mail to or call 415 883-6565 We appreciate hearing from you. Software Agreement and Disclai mer. Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies. SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose It is provided AS IS without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement SimoTime Technologies shall not be liable for any direct, indirect, special or con sequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material. Downloads Links. This section includes links to documents with additional information that are beyond the scope and purpose of this document The first sub-section requires an internet connection, the second sub-section references locally available documents. Note A SimoTime License is required for the items to be made available on a local server. Current Server or Internet Access. The following links may be to the current server or to the Internet. Note The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the icon If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the icon. Explore The Binary or COMP format for numeric data st rings This numeric structure is supported by COBOL and may be explicitly defined with the USAGE IS COMP or USAGE IS BINARY clause. Explore The Edited for Display format for numeric data strings This numeric structure is supported by COBOL and may be used with an edit-mask to prepare the presentation for readability by human beings. Explore The Packed-Decimal or COMP-3 format for numeric data strings This numeric structure is supported by COBOL and may be explicitly defined with the USAGE IS COMP-3 clause. Explore The Zoned-Decimal format for numeric data strings This numeric structure is the default numeric for COBOL and may be explicitly defined with the USAGE IS DISPLAY clause. Explore commonly used formats and processing techniques for managing various numeric formats available on the mainframe. Explore the Numbers Connection for additional information about the structure and processing of numeric data items or numeric fields. Explore How to Generate a Data File Convert Program using simp le specification statements in a Process Control File PCF This link to the User Guide includes the information necessary to create a Process Control File and generate the COBOL programs that will do the actual data file conversion The User Guide contains a list of the PCF statements that are used for the data file convert process. Explore a typical data file conversion process that may be required when working in a multi-system environment This suite of documents describes a model for managing non-relational data structures Sequential Files and VSAM Data Sets that contain ASCII or EBCDIC text strings and various numeric formats such as BINARY, PACKED-Decimal and ZONED-Decimal This model has the capability of creating a test file for an ASCII or EBCDIC encoded environment This suite of documents will address many of the challenges of doing a record content conversion of a file that will be transferred between an EBCDIC-encoded Mainframe System and an ASCII-encoded Linux, UNIX or Windows System. Explore The ASCII and EBCDIC Translation Tables These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats. Explore The File Status Return Codes to interpret the results of accessing VSAM data sets and or QSAM files. Internet Access Required. The following links will require an internet connect. A good place to start is The SimoTime Home Page for access to white papers, program examples and product information This link requires an Internet Connection. Explore The Micro Focus Web Site for more information about products and services available from Micro Focus This link requires an Internet Connection. Glossary of Terms. Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papersments or Feedback. This document was created and is copyrighted and maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please call or send a n e-mail to. We appreciate hearing from youpany Overview. SimoTime Technologies was founded in 1987 and is a privately owned company We specialize in the creation and deployment of business applications using new or existing technologies and services We have a team of individuals that understand the broad range of technologies being used in today s environments Our customers include small businesses using Internet technologies to corporations using very large mainframe systems. Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms. Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform The da ta will need to be transferred between the systems and may need to be converted and validated at various stages within the process SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment. Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at. Binary or COMP Format, a Description and Discussion.

No comments:

Post a Comment