MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

C to pl/I call

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mrinalsolanki
Beginner


Joined: 02 May 2006
Posts: 56
Topics: 16

PostPosted: Tue Jul 17, 2007 6:45 am    Post subject: C to pl/I call Reply with quote

hi ,

I created a C program.

Code:
#include<stdio.h>                   
#include<ilc.h>                     
main()                               
{                                   
   void *token;                     
   extern __pli void WRITER();       
   token = mkfmwk("PLI"," ");       
   if (!(token))  exit(16);         
   WRITER("hello world");           
   if (dlfmwk(token))  exit(8);     
   exit(0);                         
}                                   
     


Where WRITER is a PL/I function

Code:
WRITER: PROC(MESSAGE);         
    DECLARE MESSAGE CHAR(*);     
    PUT SKIP EDIT(MESSAGE)(A);   
    RETURN;                     
 END WRITER;                     
 


both the functions are compiled well.

Now the problem is linkage.
I have created a LEL file

Code:
FIRST PRAC1(C)           
LANGUAGE C,PLI2         
PROCESS LKED LIST,XREF   
AUTOCALL LC370, PLILIB   
INCLUDE OBJECT(PRAC1)   
INCLUDE OBJECT(WRITER)   
INCLUDE OBJECT(LOADMVS) 
ENTRY   MAIN             
NAME    PRAC1(R)         


But it is giving error

Code:
LSCI023 Note: Languages used in program are C and PLI2.     
                                                           
  PROCESS LKED LIST,XREF                                   
  AUTOCALL LC370, PLILIB                                   
                                                           
LSCI010 Error: Incorrect or missing data in statement.     



Please help
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Jul 17, 2007 8:50 am    Post subject: Reply with quote

mrinalsolanki,

Add the following statement in your C program after the INCLUDE

Code:

#pragma linkage(WRITER,PLI)


I suggest that you read this book

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/cbcpg150/CCONTENTS

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mrinalsolanki
Beginner


Joined: 02 May 2006
Posts: 56
Topics: 16

PostPosted: Fri Nov 16, 2007 5:06 am    Post subject: Reply with quote

I am able to successfully LinkEdit the program with input file
FIRST (C)
LANGUAGE C,PLI
PROCESS CLINK
INCLUDE OBJECT(PRACTICE)
INCLUDE OBJECT(WRITER)
INCLUDE OBJECT(L$CIMFW)
PROCESS LINK
NAME PRAC1(R)

But when trying to execute the loadlib it gives run time abend
---------------------------------------------------------------------------------------------------------------------------------------------------------
LSCX041 **** ERROR ****
ABEND occurred in MKFMWK called from line 7 of MAIN(MAIN) ,
offset 00005A
Program terminated by operating system. ABEND code = S0C1
The ABEND occurred in another task or domain
Calling trace:
Function Line Offset Context
MKFMWK(L$CIMFW) ---- 000286 Creating framework for PLI
MAIN(MAIN) 7 00005A
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=0C1 REASON CODE=00000001
TIME=03.44.18 SEQ=40729 CPU=0000 ASID=02AA
PSW AT TIME OF ERROR 078D0000 80000002 ILC 2 INTC 01
NO ACTIVE MODULE FOUND
NAME=UNKNOWN
DATA AT PSW 00000000 - 000A0000 000130E1 00000000
GR 0: A41983A8 1: 000AB968
2: 00000001 3: 24198A0C
4: 00000000 5: 00000001
6: 00000011 7: 000AB968
8: 00000000 9: 24198500
A: 24198A0D B: 00000000
C: 800A5030 D: 000AB980
E: A41985A6 F: 00000000
END OF SYMPTOM DUMP
8 *-* "CALL 'NIIT.NIIT08.MEMBLIB(PRAC1)'"
+++ RC(-193) +++
***
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please give yor idea to solve this problem
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group