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 

SET and GETMAIN

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Thu Dec 18, 2003 8:20 am    Post subject: SET and GETMAIN Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Dec 18, 2003 9:38 am    Post subject: Reply with quote

Lal,

check this link for a detailed explanation on GETMAIN.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFHCAP44/1.93?DT=19990319212537

And you also might be interested in explanation of FREEMAIN.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFHCAP44/1.78?DT=19990319212537

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
vihv
Beginner


Joined: 16 Apr 2007
Posts: 11
Topics: 4

PostPosted: Tue Apr 17, 2007 3:15 pm    Post subject: GetMain Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Apr 18, 2007 5:31 am    Post subject: Reply with quote

vihv,

Check this link for a detailed explanation of pointer.

http://home.swbell.net/mck9/cobol/tech/cobolptr.html

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
blitz2
Beginner


Joined: 23 Jan 2007
Posts: 84
Topics: 14

PostPosted: Wed Apr 18, 2007 5:47 am    Post subject: Reply with quote

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
View user's profile Send private message
vihv
Beginner


Joined: 16 Apr 2007
Posts: 11
Topics: 4

PostPosted: Wed Apr 18, 2007 11:24 am    Post subject: Reply with quote

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
View user's profile Send private message
blitz2
Beginner


Joined: 23 Jan 2007
Posts: 84
Topics: 14

PostPosted: Wed Apr 18, 2007 10:32 pm    Post subject: Reply with quote

your pointer value (WS-RET-POINTER) hasn't changed!.. Question was on pointer arithmetic.
________
Coach Handbags
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 -> CICS and Middleware 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