[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== Cobol data types in a BASIC+ program ? (OpenInsight 16-Bit Specific) ====
=== At 12 APR 2002 03:39:09AM Peter Richards wrote: ===
{{tag>"OpenInsight 16-Bit Specific"}}
Hi,
I have a record layout for COBOL, and I would like some advice please,
in how OpenInsight interprets the data types as follows:
PIC X(20)
PIC 99 COMP
PIC 9(8) COMP
PIC 9(4) COMP
PIC X value CHAR(123)
What would be the equivalent data types in OI ? I remember PIC 9(8) was 4 bytes, PIC 9(4) was 2 bytes and PIC 99 was also 2 bytes (had to be on a word boundary or something like that).
Also, is there any method in OI to just move a complete block of data, like you could do in Cobol, for something like:
01 EMPLOYEE-DETAILS PIC X(100).
03 NAME PIC X(26).
05 ADDRESS PIC X(30).
05 PHONE-NUMBER PIC 9(8) COMP.
05 ......
03 .......
03 ............
etc, etc
in Cobol, you could just do one move, to variable "EMPLOYEE-DETAILS",
then you could retrieve the individual entities. I think it is called a 'struct' function in OI, is that correct ? What data types in the struct would be equivalent to the Cobol data types ?
Regards,
Peter
----
=== At 12 APR 2002 06:33AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: ===
With packed data imports there are some simple functions to remember:
BITAND(var) can be used to do bit masking
SEQ(var) can be used if you feel more comfortable working in base 10
CHAR(var) can accept a character value and can be concatenated
OCONV() and ICONV() accept 'HEX' as the second parameter
You're probably best off treating the data as strings and substrings and carving it up from there.
[url=http://www.sprezzatura.com]The Sprezzatura Group[/url]
[i]World Leaders in all things RevSoft[/i]
[img]http://www.sprezzatura.com/zz.gif[/img]
----
=== At 12 APR 2002 06:54AM Peter Richards wrote: ===
Hi,
Okay, thanks.
Peter
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=C70E6502AF60032F88256B99002A09A8|View this thread on the forum...]]