View previous topic :: View next topic |
Author |
Message |
lal Beginner
Joined: 21 Oct 2003 Posts: 70 Topics: 25
|
Posted: Thu Dec 18, 2003 8:20 am Post subject: SET and GETMAIN |
|
|
HI Friends,
I am working with Cobol CICS application program and I have a following linkage section records.
01 AMAC-AREA-A
01 AMAC-CONTROL-A
In the procedure division we are accessing these records like
SET ADDRESS OF AMAC-AREA-A TO
TATA-LIST-PNTR.
where TATA-LIST-PNTR is a working storage pointer.
EXEC CICS GETMAIN
SET(ADDRESS OF AMAC-CONTROL-A)
FLENGTH(A-FLENGTH)
END-EXEC.
Could anybody explain me why we are doing like this??. Thanx in advance friends. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
vihv Beginner
Joined: 16 Apr 2007 Posts: 11 Topics: 4
|
Posted: Tue Apr 17, 2007 3:15 pm Post subject: GetMain |
|
|
I read the manual, and still dont understand:
EXEC CICS,GETMAIN,
SET (ADDRESS OF LOGMSG1-INTERFACE-AREA)
LENGTH (WS-MESSAGE-LENGTH)
END-EXEC
is it going to return a pointer to a "empty" area, or is it going to return an area initialized with the values of LOGMSG1-INTERFACE-AREA. now, the pointer is it returned in the LOGMSG1-INTERFACE-AREA variable.....??
Thanks |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
blitz2 Beginner
Joined: 23 Jan 2007 Posts: 84 Topics: 14
|
Posted: Wed Apr 18, 2007 5:47 am Post subject: |
|
|
Kolusu, that is a very useful link.
vihv, I see the answers to your question from the 'getmain' link that Kolusu provided earlier.
If you are familiar with C pointers, then the Cobol pointers are a cakewalk... The way I see it, Cobol pointers are (void *) equivalents of C pointers.
Now a small challenge question for beginners... How do you increment a Cobol pointer to point to the next memory location? and what about 2, 3, 4 increments?
________
Hash
Last edited by blitz2 on Thu Mar 10, 2011 5:29 pm; edited 1 time in total |
|
Back to top |
|
|
vihv Beginner
Joined: 16 Apr 2007 Posts: 11 Topics: 4
|
Posted: Wed Apr 18, 2007 11:24 am Post subject: |
|
|
You right...I was just a little confused.....
about How do you increment a Cobol pointer to point to the next memory location? and what about 2, 3, 4 increments?
EXEC CICS RETRIEVE
SET (ADDRESS OF VCMP-CONTROL-AREA)
LENGTH (WS-RETRIEVE-LENGTH)
END-EXEC
SET WS-RET-POINTER TO ADDRESS OF VCMP-CONTROL-AREA
MOVE LENGTH OF VCMP-CNTL-ADDRESS-AREA TO WS-CNTL-LENGTH
ADD WS-RETRIEVE-LENGTH WS-CNTL-LENGTH
GIVING WS-GETMAIN-LENGTH |
|
Back to top |
|
|
blitz2 Beginner
Joined: 23 Jan 2007 Posts: 84 Topics: 14
|
Posted: Wed Apr 18, 2007 10:32 pm Post subject: |
|
|
your pointer value (WS-RET-POINTER) hasn't changed!.. Question was on pointer arithmetic.
________
Coach Handbags |
|
Back to top |
|
|
|
|