View previous topic :: View next topic |
Author |
Message |
Rama_Prayaga Beginner

Joined: 20 May 2003 Posts: 45 Topics: 15
|
Posted: Sat Dec 18, 2004 10:12 am Post subject: Moving structure to a a variable field in Pl/1 |
|
|
Hi,
I am having a problem moving a lvl - 1struture to a variable field of another structure in PL/1 .This is what I have to do.
Code: | DCL 1 Details,
02 field_name1 char(29),
02 field_name2 char(29),
02 field_name3 char(29),
02 field_name4 char(29),
02 field_name5 char(29),
02 field_name6 char(29); |
Code: | dcl 1 log_Record
02 program_name char(10),
02 MESSAGE CHAR(3000) VAR; |
What I have to do is
Code: | log_record.MESSAGE = Details; |
If i do the same as above I am getting the following error.
IEL0643I S 267 INVALID USE OF STRUCTURE 'details' IN ARRAY OR ELEMENT ASSIGNMENT. STATEMENT IGNORED.
Please let me know how to proceed further.
Regards,
Rama Krishna Prayaga. |
|
Back to top |
|
 |
bauer Intermediate
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
|
Posted: Mon Dec 20, 2004 3:00 am Post subject: |
|
|
Hi,
do it like this:
DCL X CHAR(174) based(addr(details)); /* 6 * 29 Byte */
log_record.message = x ;
regards,
bauer |
|
Back to top |
|
 |
Rama_Prayaga Beginner

Joined: 20 May 2003 Posts: 45 Topics: 15
|
Posted: Mon Dec 20, 2004 3:56 am Post subject: |
|
|
Hi Bauer,
Thank you,
its working fine ,
Regards,
Rama_Prayaga |
|
Back to top |
|
 |
grajeevg Beginner
Joined: 11 Jun 2004 Posts: 5 Topics: 2
|
Posted: Wed Jan 12, 2005 1:36 am Post subject: |
|
|
Rama_Prayaga,
You can try with STRING function. By using string function you can assign a group item to single string.
for exp
log_record.MESSAGE = String(Details)
Try this .
Regards,
Rajasekhar Reddy. |
|
Back to top |
|
 |
|
|