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 

Problem while passing a PL1 structure having varchar fields

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


Joined: 29 Sep 2004
Posts: 53
Topics: 14

PostPosted: Tue Dec 07, 2004 1:48 am    Post subject: Problem while passing a PL1 structure having varchar fields Reply with quote

Hi,

DCl 1 STRUC based(STRUC_PTR),
5 ABC varchar(100),
5 DEF varchar(100);


I have a PL1 module A having the above structure. After filling the data, I'm passing STRUC_PTR to PL1 module B. Inside module B, i'm getting junk values in ABC and DEF. This is happening only if i pass varchar fields. If i declared ABC and DEF as char fields and passed STRUC_PTR to module B, i'm getting the correct values. But i need to pass varchar, not char. Can anyone let me know what the problem could be?

Thanks.
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Tue Dec 07, 2004 2:25 am    Post subject: Reply with quote

Hi,

how is the declaration of STRUC_PTR in modul A, is there any allocate for STRUC ?


This way works:

Module A
=======


DCL 1 STRUCT,
5 ABC char(100) varying;

CALL B(ADDR(STRUCT));


Module B
======


B: PROC (x) ;
DCL X PTR ;

DCL 1 STRUCT BASED(x),
5 ABC char(100) varying;

PUT SKIP EDIT(STRUCT.ABC)(A)


regards,
bauer
Back to top
View user's profile Send private message
whizkid79
Beginner


Joined: 29 Sep 2004
Posts: 53
Topics: 14

PostPosted: Fri Dec 10, 2004 12:03 am    Post subject: Reply with quote

I'll give it a try. Thanks for your help.
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