C-Isam in Cobol/C 
Author Message
 C-Isam in Cobol/C

Hello,
Hallo,
I have problems with C-Isam. I would produce and read ISAM-Files in
C and in Cobol parallel, but I have problems with integer respectivily
9(0?).

For Example in C:

 ...
 TEST_KEY.k_flags=ISNODUPS;
 TEST_KEY.k_nparts=1;
 TEST_KEY.k_part[0].kp_start=0;
 TEST_KEY.k_part[0].kp_leng=2;
 TEST_KEY.k_part[0].kp_type=INTTYPE; <-- wrong size?
 ...

in Cobol:
        01  TEST0001-SATZ.
            05 TEST-KEY.
               10 TEST-NR                  PIC  9(02). <--
            05 TEST-TEXT                   PIC  X(60).
            05 TEST-TEXT-2                 PIC  X(60).

this is o.k.:

 ...
 TEST_KEY.k_flags=ISNODUPS;
 TEST_KEY.k_nparts=1;
 TEST_KEY.k_part[0].kp_start=0;
 TEST_KEY.k_part[0].kp_leng=2;
 TEST_KEY.k_part[0].kp_type=CHARTYPE;
 ...

in Cobol:
        01  TEST0001-SATZ.
            05 TEST-KEY.
               10 TEST-NR                  PIC  X(02). <--
            05 TEST-TEXT                   PIC  X(60).
            05 TEST-TEXT-2                 PIC  X(60).

Who is able to help me.

the full source:
----------------

#include <stdio.h>
#include <isam.h>
#define SUCCESS 0

struct keydesc TEST_KEY;
int cc, fdTEST0001;
char TEST0001_SATZ[122];
int NUM;
char line[122];
main()
{
//TEST0001-anlegen
 TEST_KEY.k_flags=ISNODUPS;
 TEST_KEY.k_nparts=1;
 TEST_KEY.k_part[0].kp_start=0;
 TEST_KEY.k_part[0].kp_leng=2;
 TEST_KEY.k_part[0].kp_type=INTTYPE;
 fdTEST0001=cc=isbuild("TEST0001", 122, &TEST_KEY, ISINOUT + ISEXCLLOCK);
 if (cc<SUCCESS)
 {
  printf("isbuild error %d for TEST0001 file\n", iserrno);
  exit(1);
 }
 isclose(fdTEST0001);

//TEST0001-lesen
 fdTEST0001=cc=isopen("TEST0001", ISAUTOLOCK+ISOUTPUT);
 if (cc<SUCCESS)
 {
  printf("isopen error %d for TEST0001 file\n", iserrno);
 }
 getTEST0001();
 addTEST0001();
 isclose(fdTEST0001);

Quote:
}

getTEST0001()
{
 printf("Nummer eingeben: ");
 fgets(line, 80, stdin);
 sscanf(line, "%i", &NUM);
 stint(NUM, TEST0001_SATZ);

 printf("Text: ");
 fgets(line, 80, stdin);
 ststring(line, TEST0001_SATZ+2, 60);

 printf("Text 2: ");
 fgets(line, 80, stdin);
 ststring(line, TEST0001_SATZ+62, 20);

Quote:
}

ststring(char *src, char *dest, int num)
 {
  int i;
  for (i=1;i<=num && *src != '\n' && *src != '\0' && src != 0; i++)
*dest++=*src++;

  while (i++ <=num) *dest++=' ';

Quote:
}

addTEST0001()
{
 int cc;
 cc=iswrite(fdTEST0001, TEST0001_SATZ);
 if (cc != SUCCESS)
 {
  printf("iswrite error %d for TEST0001\n", iserrno);
  isclose(fdTEST0001);
  exit(1);
 }

Quote:
}

       IDENTIFICATION DIVISION.
       PROGRAM-ID. READING.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.

           SELECT TEST0001
           ASSIGN TO "TEST0001"
           ORGANIZATION INDEXED
           ACCESS DYNAMIC
           RECORD KEY TEST-KEY
           FILE STATUS TEST0001-STATUS.

       DATA DIVISION.
       FILE SECTION.
        FD  TEST0001
            LABEL RECORD IS STANDARD
            DATA  RECORD IS TEST0001-SATZ.
        01  TEST0001-SATZ.
            05 TEST-KEY.
               10 TEST-NR                  PIC  9(02).
            05 TEST-TEXT                   PIC  X(60).
            05 TEST-TEXT-2                 PIC  X(60).

       WORKING-STORAGE SECTION.
       77  WAHL                            PIC  X(01).
       77  TEST0001-STATUS             PIC XX.
       77  DATEI-STATUS                PIC XX.
       77  FEHLER-DATEI                PIC X(08)       VALUE SPACES.
       77 INV-79                       PIC  X(79)      VALUE SPACES.
       77 FILLER                       PIC X(01)       VALUE "J".
          88 LOOP                                      VALUE "J".
          88 END-LOOP                                  VALUE "N".

       PROCEDURE DIVISION.

       DECLARATIVES.

       TEST0001-FEH SECTION.
           USE AFTER ERROR PROCEDURE ON TEST0001.
       TEST0001-FEH-001.
           MOVE TEST0001-STATUS TO DATEI-STATUS.
           MOVE "TEST0001" TO FEHLER-DATEI.
       TEST0001-FEH-999.
           EXIT.

       END DECLARATIVES.

       ANFANG SECTION .

           OPEN INPUT                  TEST0001.
           IF TEST0001-STATUS > "00"   GO TO FEHLER-ROUT          END-IF

           INITIALIZE                  TEST-KEY
           START TEST0001 KEY NOT LESS THAN TEST-KEY
             INVALID KEY PERFORM TEST0001-FEH-001
                            THRU TEST0001-FEH-999
           END-START
           IF TEST0001-STATUS = "23" PERFORM FEHLER-ROUT ELSE
           IF TEST0001-STATUS > "02" GO TO FEHLER-ROUT     END-IF END-IF

           PERFORM WITH TEST BEFORE UNTIL
           (END-LOOP OR TEST0001-STATUS = "23")
            READ TEST0001 NEXT        AT END EXIT PERFORM       END-READ
            IF TEST0001-STATUS = "92" PERFORM FEHLER-ROUT
                                      EXIT PERFORM CYCLE          END-IF
            IF TEST0001-STATUS > "02" GO TO FEHLER-ROUT           END-IF

            DISPLAY TEST-NR           LINE 10 POSITION 10
            DISPLAY TEST-TEXT         LINE 11 POSITION 10
            DISPLAY TEST-TEXT-2       LINE 12 POSITION 10
            ACCEPT WAHL END-ACCEPT
           END-PERFORM
           CLOSE                      TEST0001
           STOP RUN.
           .
         FEHLER-ROUT.
             DISPLAY INV-79 LINE 24 POSITION 01 REVERSE.
             DISPLAY "(FEHLER)" LINE 24 POSITION 01 REVERSE
             DISPLAY DATEI-STATUS LINE 24 POSITION 12 REVERSE.
             DISPLAY "00" LINE 24 POSITION 14 REVERSE.
             DISPLAY FEHLER-DATEI LINE 24 POSITION 18 REVERSE
             IF DATEI-STATUS = "04"
                DISPLAY "*** FALSCHE SATZL?NGE ***"
                LINE 24 POSITION 30 REVERSE.
             IF DATEI-STATUS = "05"
                DISPLAY "*** PERMANETER FEHLER ***"
                LINE 24 POSITION 30 REVERSE.
             IF DATEI-STATUS = "22"
                DISPLAY "*** SATZ BEREITS VORHANDEN ***"
                LINE 24 POSITION 30 REVERSE.
             IF DATEI-STATUS = "23"
                DISPLAY "*** SATZ NICHT VORHANDEN ***"
                LINE 24 POSITION 30 REVERSE.
             IF DATEI-STATUS = "30"
                DISPLAY "*** ERFOLGLOSE E/A-OPERATION ***"
                LINE 24 POSITION 30 REVERSE.
             IF DATEI-STATUS = "90"
                DISPLAY "****** DOPPELTER OPEN *******"
                LINE 24 POSITION 30 REVERSE.
             IF DATEI-STATUS = "91"
                DISPLAY "*** PERMANETER FEHLER ***"
                LINE 24 POSITION 30 REVERSE.
             IF DATEI-STATUS = "92"
                DISPLAY "*** SATZ IST IN BENUTZUNG ***"
                LINE 24 POSITION 30 REVERSE.
             IF DATEI-STATUS = "93"
                DISPLAY "*** DATEI GESPERRT ***"
                LINE 24 POSITION 30 REVERSE.
             IF DATEI-STATUS > 30 AND DATEI-STATUS < 90
                DISPLAY "*** PERMANENTER FEHLER ***"
                LINE 24 POSITION 30 REVERSE.
             ACCEPT WAHL LINE 24 POSITION 00 TAB
             DISPLAY INV-79 LINE 24 POSITION 01.
             .
         FEHLER-ROUT-90000.
             STOP RUN.

--
__________________________________________________________
News suchen, lesen, schreiben mit http://www.*-*-*.com/



Sat, 03 Jul 2004 00:10:04 GMT  
 C-Isam in Cobol/C
A PIC 9(2) in COBOL is just a PIC X(2) that is right-justified and
zero-filled on the left, i.e. the value 3 would be stored as "03". If you
have a signed field, it does something weird with the units character, but
it's still essentially an alphanumeric string. To get numbers stored as
integers, you have to start playing with USAGE COMP-X stuff.


Quote:
> Hello,
> Hallo,
> I have problems with C-Isam. I would produce and read ISAM-Files in
> C and in Cobol parallel, but I have problems with integer respectivily
> 9(0?).

> For Example in C:

>  ...
>  TEST_KEY.k_flags=ISNODUPS;
>  TEST_KEY.k_nparts=1;
>  TEST_KEY.k_part[0].kp_start=0;
>  TEST_KEY.k_part[0].kp_leng=2;
>  TEST_KEY.k_part[0].kp_type=INTTYPE; <-- wrong size?
>  ...

> in Cobol:
>         01  TEST0001-SATZ.
>             05 TEST-KEY.
>                10 TEST-NR                  PIC  9(02). <--
>             05 TEST-TEXT                   PIC  X(60).
>             05 TEST-TEXT-2                 PIC  X(60).

> this is o.k.:

>  ...
>  TEST_KEY.k_flags=ISNODUPS;
>  TEST_KEY.k_nparts=1;
>  TEST_KEY.k_part[0].kp_start=0;
>  TEST_KEY.k_part[0].kp_leng=2;
>  TEST_KEY.k_part[0].kp_type=CHARTYPE;
>  ...

> in Cobol:
>         01  TEST0001-SATZ.
>             05 TEST-KEY.
>                10 TEST-NR                  PIC  X(02). <--
>             05 TEST-TEXT                   PIC  X(60).
>             05 TEST-TEXT-2                 PIC  X(60).

> Who is able to help me.

> the full source:
> ----------------

> #include <stdio.h>
> #include <isam.h>
> #define SUCCESS 0

> struct keydesc TEST_KEY;
> int cc, fdTEST0001;
> char TEST0001_SATZ[122];
> int NUM;
> char line[122];
> main()
> {
> file://TEST0001-anlegen
>  TEST_KEY.k_flags=ISNODUPS;
>  TEST_KEY.k_nparts=1;
>  TEST_KEY.k_part[0].kp_start=0;
>  TEST_KEY.k_part[0].kp_leng=2;
>  TEST_KEY.k_part[0].kp_type=INTTYPE;
>  fdTEST0001=cc=isbuild("TEST0001", 122, &TEST_KEY, ISINOUT + ISEXCLLOCK);
>  if (cc<SUCCESS)
>  {
>   printf("isbuild error %d for TEST0001 file\n", iserrno);
>   exit(1);
>  }
>  isclose(fdTEST0001);

> file://TEST0001-lesen
>  fdTEST0001=cc=isopen("TEST0001", ISAUTOLOCK+ISOUTPUT);
>  if (cc<SUCCESS)
>  {
>   printf("isopen error %d for TEST0001 file\n", iserrno);
>  }
>  getTEST0001();
>  addTEST0001();
>  isclose(fdTEST0001);
> }
> getTEST0001()
> {
>  printf("Nummer eingeben: ");
>  fgets(line, 80, stdin);
>  sscanf(line, "%i", &NUM);
>  stint(NUM, TEST0001_SATZ);

>  printf("Text: ");
>  fgets(line, 80, stdin);
>  ststring(line, TEST0001_SATZ+2, 60);

>  printf("Text 2: ");
>  fgets(line, 80, stdin);
>  ststring(line, TEST0001_SATZ+62, 20);

> }
> ststring(char *src, char *dest, int num)
>  {
>   int i;
>   for (i=1;i<=num && *src != '\n' && *src != '\0' && src != 0; i++)
> *dest++=*src++;

>   while (i++ <=num) *dest++=' ';
> }

> addTEST0001()
> {
>  int cc;
>  cc=iswrite(fdTEST0001, TEST0001_SATZ);
>  if (cc != SUCCESS)
>  {
>   printf("iswrite error %d for TEST0001\n", iserrno);
>   isclose(fdTEST0001);
>   exit(1);
>  }
> }

>        IDENTIFICATION DIVISION.
>        PROGRAM-ID. READING.
>        INPUT-OUTPUT SECTION.
>        FILE-CONTROL.

>            SELECT TEST0001
>            ASSIGN TO "TEST0001"
>            ORGANIZATION INDEXED
>            ACCESS DYNAMIC
>            RECORD KEY TEST-KEY
>            FILE STATUS TEST0001-STATUS.

>        DATA DIVISION.
>        FILE SECTION.
>         FD  TEST0001
>             LABEL RECORD IS STANDARD
>             DATA  RECORD IS TEST0001-SATZ.
>         01  TEST0001-SATZ.
>             05 TEST-KEY.
>                10 TEST-NR                  PIC  9(02).
>             05 TEST-TEXT                   PIC  X(60).
>             05 TEST-TEXT-2                 PIC  X(60).

>        WORKING-STORAGE SECTION.
>        77  WAHL                            PIC  X(01).
>        77  TEST0001-STATUS             PIC XX.
>        77  DATEI-STATUS                PIC XX.
>        77  FEHLER-DATEI                PIC X(08)       VALUE SPACES.
>        77 INV-79                       PIC  X(79)      VALUE SPACES.
>        77 FILLER                       PIC X(01)       VALUE "J".
>           88 LOOP                                      VALUE "J".
>           88 END-LOOP                                  VALUE "N".

>        PROCEDURE DIVISION.

>        DECLARATIVES.

>        TEST0001-FEH SECTION.
>            USE AFTER ERROR PROCEDURE ON TEST0001.
>        TEST0001-FEH-001.
>            MOVE TEST0001-STATUS TO DATEI-STATUS.
>            MOVE "TEST0001" TO FEHLER-DATEI.
>        TEST0001-FEH-999.
>            EXIT.

>        END DECLARATIVES.

>        ANFANG SECTION .

>            OPEN INPUT                  TEST0001.
>            IF TEST0001-STATUS > "00"   GO TO FEHLER-ROUT          END-IF

>            INITIALIZE                  TEST-KEY
>            START TEST0001 KEY NOT LESS THAN TEST-KEY
>              INVALID KEY PERFORM TEST0001-FEH-001
>                             THRU TEST0001-FEH-999
>            END-START
>            IF TEST0001-STATUS = "23" PERFORM FEHLER-ROUT ELSE
>            IF TEST0001-STATUS > "02" GO TO FEHLER-ROUT     END-IF END-IF

>            PERFORM WITH TEST BEFORE UNTIL
>            (END-LOOP OR TEST0001-STATUS = "23")
>             READ TEST0001 NEXT        AT END EXIT PERFORM       END-READ
>             IF TEST0001-STATUS = "92" PERFORM FEHLER-ROUT
>                                       EXIT PERFORM CYCLE          END-IF
>             IF TEST0001-STATUS > "02" GO TO FEHLER-ROUT           END-IF

>             DISPLAY TEST-NR           LINE 10 POSITION 10
>             DISPLAY TEST-TEXT         LINE 11 POSITION 10
>             DISPLAY TEST-TEXT-2       LINE 12 POSITION 10
>             ACCEPT WAHL END-ACCEPT
>            END-PERFORM
>            CLOSE                      TEST0001
>            STOP RUN.
>            .
>          FEHLER-ROUT.
>              DISPLAY INV-79 LINE 24 POSITION 01 REVERSE.
>              DISPLAY "(FEHLER)" LINE 24 POSITION 01 REVERSE
>              DISPLAY DATEI-STATUS LINE 24 POSITION 12 REVERSE.
>              DISPLAY "00" LINE 24 POSITION 14 REVERSE.
>              DISPLAY FEHLER-DATEI LINE 24 POSITION 18 REVERSE
>              IF DATEI-STATUS = "04"
>                 DISPLAY "*** FALSCHE SATZL?NGE ***"
>                 LINE 24 POSITION 30 REVERSE.
>              IF DATEI-STATUS = "05"
>                 DISPLAY "*** PERMANETER FEHLER ***"
>                 LINE 24 POSITION 30 REVERSE.
>              IF DATEI-STATUS = "22"
>                 DISPLAY "*** SATZ BEREITS VORHANDEN ***"
>                 LINE 24 POSITION 30 REVERSE.
>              IF DATEI-STATUS = "23"
>                 DISPLAY "*** SATZ NICHT VORHANDEN ***"
>                 LINE 24 POSITION 30 REVERSE.
>              IF DATEI-STATUS = "30"
>                 DISPLAY "*** ERFOLGLOSE E/A-OPERATION ***"
>                 LINE 24 POSITION 30 REVERSE.
>              IF DATEI-STATUS = "90"
>                 DISPLAY "****** DOPPELTER OPEN *******"
>                 LINE 24 POSITION 30 REVERSE.
>              IF DATEI-STATUS = "91"
>                 DISPLAY "*** PERMANETER FEHLER ***"
>                 LINE 24 POSITION 30 REVERSE.
>              IF DATEI-STATUS = "92"
>                 DISPLAY "*** SATZ IST IN BENUTZUNG ***"
>                 LINE 24 POSITION 30 REVERSE.
>              IF DATEI-STATUS = "93"
>                 DISPLAY "*** DATEI GESPERRT ***"
>                 LINE 24 POSITION 30 REVERSE.
>              IF DATEI-STATUS > 30 AND DATEI-STATUS < 90
>                 DISPLAY "*** PERMANENTER FEHLER ***"
>                 LINE 24 POSITION 30 REVERSE.
>              ACCEPT WAHL LINE 24 POSITION 00 TAB
>              DISPLAY INV-79 LINE 24 POSITION 01.
>              .
>          FEHLER-ROUT-90000.
>              STOP RUN.

> --
> __________________________________________________________
> News suchen, lesen, schreiben mit http://newsgroups.web.de



Sat, 03 Jul 2004 06:35:18 GMT  
 C-Isam in Cobol/C
I think discussion of C-Islam belongs on the "Religion and COBOL" thread.

Stephen J Spiro



Sat, 03 Jul 2004 07:29:33 GMT  
 C-Isam in Cobol/C


Quote:
> I think discussion of C-Islam belongs on the "Religion and COBOL" thread.

> Stephen J Spiro

ROLFL.

Donald.



Sat, 03 Jul 2004 07:44:07 GMT  
 C-Isam in Cobol/C

Quote:

>A PIC 9(2) in COBOL is just a PIC X(2) that is right-justified and
>zero-filled on the left, i.e. the value 3 would be stored as "03". If you
>have a signed field, it does something weird with the units character, but
>it's still essentially an alphanumeric string. To get numbers stored as
>integers, you have to start playing with USAGE COMP-X stuff.

Thank you, the programm works with Pic (4) COMP-X correctly.

But what can I do, when I create a ISAM-File in Cobol whith the following
contents:
        PIC 9(2).
                PIC 9(3).
                PIC 9(4)   Comp-3.

Can I read such fields under C ?

Daniel

--
__________________________________________________________
News suchen, lesen, schreiben mit http://newsgroups.web.de



Sat, 03 Jul 2004 21:54:35 GMT  
 C-Isam in Cobol/C
The comp-x usages of cobol tend to be implementation-specific. Read your
manual to find out what comp-3 is on your machine. It it's stored internally
as a native INT, then you can easily read the field in C.


Quote:

> >A PIC 9(2) in COBOL is just a PIC X(2) that is right-justified and
> >zero-filled on the left, i.e. the value 3 would be stored as "03". If you
> >have a signed field, it does something weird with the units character,
but
> >it's still essentially an alphanumeric string. To get numbers stored as
> >integers, you have to start playing with USAGE COMP-X stuff.

> Thank you, the programm works with Pic (4) COMP-X correctly.

> But what can I do, when I create a ISAM-File in Cobol whith the following
> contents:
> PIC 9(2).
>                 PIC 9(3).
>                 PIC 9(4)   Comp-3.

> Can I read such fields under C ?

> Daniel

> --
> __________________________________________________________
> News suchen, lesen, schreiben mit http://newsgroups.web.de



Sun, 04 Jul 2004 01:31:02 GMT  
 C-Isam in Cobol/C

Quote:

>The comp-x usages of cobol tend to be implementation-specific. Read your
>manual to find out what comp-3 is on your machine. It it's stored internally
>as a native INT, then you can easily read the field in C.

Hallo,
the manual say:
For COMP-3 (packed-decimal storage), two digits are stored in each byte. An
additional half byte is allocated for the sign, even if the value is unsigned.
The sign is placed in the rightmost position. The sign value is 0x0D for
negative; all other values are treated as positive (but see rule 18 below).  Th
e size
of an item is divided by two (after including one for the implied sign) to
arrive at its actual size (rounding fractions up).

What do you think, can I read such value in C, C++ ... ?
--
__________________________________________________________
News suchen, lesen, schreiben mit http://newsgroups.web.de



Wed, 07 Jul 2004 00:01:29 GMT  
 C-Isam in Cobol/C
Of course you can -- however, since it isn't a "native" format, the C
program will have to know how to handle it.


Quote:

> What do you think, can I read such value in C, C++ ... ?
> --
> __________________________________________________________
> News suchen, lesen, schreiben mit http://newsgroups.web.de



Wed, 07 Jul 2004 00:03:44 GMT  
 C-Isam in Cobol/C

Quote:
> the manual say:
> For COMP-3 (packed-decimal storage), two digits are stored in each byte.
An
> additional half byte is allocated for the sign, even if the value is
unsigned.
> The sign is placed in the rightmost position. The sign value is 0x0D for
> negative; all other values are treated as positive (but see rule 18
below).  Th
> e size
> of an item is divided by two (after including one for the implied sign) to
> arrive at its actual size (rounding fractions up).

> What do you think, can I read such value in C, C++ ... ?
> --

I have a WIn/32 DLL you can use to convert data stored in COBOL data types
to IEEE datatypes (it was designed to allow non-COBOL programmers to access
COBOL-created data). So the answer is, "yes, you can."

Send me a note and I'll get you some more info.

--
Michael Mattias
Tal Systems, Inc.
Racine WI



Wed, 07 Jul 2004 03:44:47 GMT  
 C-Isam in Cobol/C
On 18 Jan 2002 17:01:29 +0100, Daniel Niedzielski

Quote:

>the manual say:
>For COMP-3 (packed-decimal storage), two digits are stored in each byte. An
>additional half byte is allocated for the sign, even if the value is unsigned.
>The sign is placed in the rightmost position. The sign value is 0x0D for
>negative; all other values are treated as positive (but see rule 18 below).

Then the manual is wrong.  X'B' is also negative sign

Quote:
> The size
>of an item is divided by two (after including one for the implied sign) to
>arrive at its actual size (rounding fractions up).

>What do you think, can I read such value in C, C++ ... ?

Read?  Sure.  Work with, like as operators on mathematical expression?
I think it cannot be done in C, but should be possible in C++

     With kind Regards            |\      _,,,---,,_        
                            ZZZzz /,`.-'`'    -.  ;-;;,    
     Volker Bandke               |,4-  ) )-,_. ,\ (  `'-'  
      (BSP GmbH)                '---''(_/--'  `-'\_)        

      The more things change, the more they'll never be the same again.

        (Another Wisdom from my fortune cookie jar)        
______________________________________________________________________________
Posted Via Binaries.net = SPEED+RETENTION+COMPLETION = http://www.binaries.net



Wed, 07 Jul 2004 15:54:17 GMT  
 C-Isam in Cobol/C
I hate to disagree with you Volker, BUT ...

Given the reference to "C-ISAM" in the subject line, my GUESS is that this
is NOT an IBM mainframe environment.  THEREFORE, the chances are (medium
good) that X'0B' is NOT a valid negative sign-nibble.

Even on IBM mainframes (with COBOL for this-and-that) the NUMCLS compiler
(installation) option determines whether COBOL does or DOES NOT accept X"0B"
as a valid negative sign (in an IF NUMERIC test, for example), see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3c101/2...

Notice that the IBM supplied default *only* accepts C, D, and F as "valid"
sign-nibbles.  Of course regardless of the COBOL option, "native" S/370,
OS/390, and z/OS assembler instruction DO accept A-F as valid signs.

--
Bill Klein
 wmklein <at> ix.netcom.com

Quote:
> On 18 Jan 2002 17:01:29 +0100, Daniel Niedzielski

> >the manual say:
> >For COMP-3 (packed-decimal storage), two digits are stored in each byte.
An
> >additional half byte is allocated for the sign, even if the value is
unsigned.
> >The sign is placed in the rightmost position. The sign value is 0x0D for
> >negative; all other values are treated as positive (but see rule 18
below).

> Then the manual is wrong.  X'B' is also negative sign

> > The size
> >of an item is divided by two (after including one for the implied sign)
to
> >arrive at its actual size (rounding fractions up).

> >What do you think, can I read such value in C, C++ ... ?

> Read?  Sure.  Work with, like as operators on mathematical expression?
> I think it cannot be done in C, but should be possible in C++

>      With kind Regards            |\      _,,,---,,_
>                             ZZZzz /,`.-'`'    -.  ;-;;,
>      Volker Bandke               |,4-  ) )-,_. ,\ (  `'-'
>       (BSP GmbH)                '---''(_/--'  `-'\_)

>       The more things change, the more they'll never be the same again.

>         (Another Wisdom from my fortune cookie jar)

____________________________________________________________________________
__
Quote:
> Posted Via Binaries.net = SPEED+RETENTION+COMPLETION =

http://www.binaries.net


Thu, 08 Jul 2004 02:13:40 GMT  
 C-Isam in Cobol/C
On Sat, 19 Jan 2002 12:13:40 -0600, "William M. Klein"

Quote:

>I hate to disagree with you Volker, BUT ...

>Given the reference to "C-ISAM" in the subject line, my GUESS is that this
>is NOT an IBM mainframe environment.  

Guilty as charged.  To my defense, though, please note that so many
people talk about ISAM and just mean any type of keyed dataset, that
the C-ISAM thingie just didn't ring a bell here

Quote:
>THEREFORE, the chances are (medium
>good) that X'0B' is NOT a valid negative sign-nibble.

>Even on IBM mainframes (with COBOL for this-and-that) the NUMCLS compiler
>(installation) option determines whether COBOL does or DOES NOT accept X"0B"
>as a valid negative sign (in an IF NUMERIC test, for example), see:

Maybe, but this can be overridden by the NUMPROC(PFD|NOPFD) compile
time option

Quote:

>http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3c101/2...

>Notice that the IBM supplied default *only* accepts C, D, and F as "valid"
>sign-nibbles.

NUMPROC(PFD) doesn't even accept X'0F'

Thanks for your message

     With kind Regards            |\      _,,,---,,_        
                            ZZZzz /,`.-'`'    -.  ;-;;,    
     Volker Bandke               |,4-  ) )-,_. ,\ (  `'-'  
      (BSP GmbH)                '---''(_/--'  `-'\_)        

      Lesser known machine instructions - EOS: Erase Operating System

        (Another Wisdom from my fortune cookie jar)        
______________________________________________________________________________
Posted Via Binaries.net = SPEED+RETENTION+COMPLETION = http://www.binaries.net



Thu, 08 Jul 2004 03:28:22 GMT  
 C-Isam in Cobol/C
Hello,
I need it for Unix/Linux. Could you send me Information about Converting
data types?

Thank you

Quote:
>I have a WIn/32 DLL you can use to convert data stored in COBOL data types
>to IEEE datatypes (it was designed to allow non-COBOL programmers to access
>COBOL-created data). So the answer is, "yes, you can."

>Send me a note and I'll get you some more info.

--
__________________________________________________________
News suchen, lesen, schreiben mit http://newsgroups.web.de


Fri, 09 Jul 2004 23:33:15 GMT  
 C-Isam in Cobol/C

Quote:
> Hello,
> I need it for Unix/Linux. Could you send me Information about Converting
> data types?

> >I have a WIn/32 DLL you can use to convert data stored in COBOL data
types
> >to IEEE datatypes (it was designed to allow non-COBOL programmers to
access
> >COBOL-created data). So the answer is, "yes, you can."

IF OPERATING-SYSTEM NOT EQUAL WIN32
   GO TO  http://www.flexus.com/download.html
END-IF

http://www.flexus.com/download.html.
   OPEN "COBDATA.ZIP"
   READ INCLUDED-TEXT-FILE
   PERFORM INCLUDED-GRAPHIC-TUTORIAL
   SEND THANK-YOU-MESSAGE FROM BOTTOM-OF-HEART.

MCM



Sat, 10 Jul 2004 04:58:47 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. to CS: or not to CS: in F-PC assembler

2. COBOL/VSAM/Contract/CS/Tx

3. Help a Non Cobol CS Instructor with CASE...

4. * US-OH-COLUMBUS-PA-COBOL/IMS/CICS

5. ISAM, old Microsoft ISAM, Alternate Index, Micro Focus Visual Object Cobol

6. Camp Smalltalk (CS 6) registration

7. APL as First Language for CS

8. SoftEng or CS Graduate Program Search

9. Test and Set (TS) vs Compare and Swap (CS)

10. Refactored Plus All Missing CS ANSI Tests In SIF

11. Camp Smalltalk (CS 6) registration

12. vwnc@cs.uiuc.edu

 

 
Powered by phpBB® Forum Software