View previous topic :: View next topic
|
Author |
Message |
arkabag
New User
Joined: 10 Apr 2009 Posts: 3 Location: India
|
|
|
|
Hi,
I would like to call a C function from a cobol program. The passing parameter would be of the form:
Code: |
01 WS-MOV-DATOS WITH LOWER-BOUNDS.
03 WS-MOV-FUNCION PIC 9(02) COMP.
03 WS-MOV-SISTEMA PIC 9(04) COMP.
03 WS-MOV-PRODUCTO PIC 9(04) COMP.
03 WS-TAB-CVEIMP OCCURS 5 TIMES.
04 WS-MOV-CVETRAN PIC 9(04) COMP.
04 WS-MOV-INDLEY PIC 9(02) COMP.
04 WS-MOV-ESQCON PIC 9(04) COMP.
04 WS-MOV-IMPORTE PIC 9(14)V99 COMP.
|
The calling portion of code:
Code: |
CALL "CARGAMOV1 IN L151-REGISTRA" USING WS-MOV-DATOS
GIVING WS-S151-RESULT
|
How do I receive the passed parameters in C language and convert the binary-formatted cobol variables into displayable format in C?
Regards,
Arkayan |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
If you haven't already read this, go to www.s390.ibm.com and find the book z/OS Language Environment Writing Interlanguage Communication Applications, SA22-7563. It will be found in the Language Environment bookshelf. Read this (particularly chapter 4 which is titled Communicating between C and COBOL) until your questions are answered -- or if something isn't clear, post your question after reading. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
In an unrelated question to your post, what is LOWER-BOUNDS and CALL.... GIVING?
Neither of these are documented in any Enterprise COBOL manual.
Documentation for CALL.... RETURNING is present but there wasn't any reference (or equivalent) to LOWER-BOUNDS.
Regards, |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Another question.
Is there any reason field WS-MOV-IMPORTE is defined as a binary-dblword (8-Bytes). It's probably one of the worst (or the worst) definition possible for COBOL arithmetic (a/k/a a Dog with Fleas)
Unless you have unique business-related reasons to define it this way, I would re-considered making it PACKED-DECIMAL/COMP-3.
Regards, |
|
Back to top |
|
|
|