Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Need the syntax of 'BASED' used in PL/1 pgms

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER
Author Message
spriya

New User


Joined: 06 Oct 2005
Posts: 40

PostPosted: Tue Jul 25, 2006 12:32 pm    Post subject: Need the syntax of 'BASED' used in PL/1 pgms
Reply with quote

HI,

Anybody explain the syntax 'BASED' using in PL/1 pgms

ex:
DCL (PTR_DRAF) POINTER


INPUT_STRUC BASED (PTR_DRAF),

explain this example
Back to top
View user's profile Send private message
References
shameer007

New User


Joined: 20 Apr 2006
Posts: 13

PostPosted: Fri Aug 18, 2006 8:20 pm    Post subject: Re: Need the syntax of 'BASED' used in PL/1 pgms
Reply with quote

spriya wrote:
HI,

Anybody explain the syntax 'BASED' using in PL/1 pgms

ex:
DCL (PTR_DRAF) POINTER


INPUT_STRUC BASED (PTR_DRAF),

explain this example



Hi,

This program will give basic idea about Based pointer.. If u still have doubt Let me know I will give some more examples..

POINT6: PROC OPTIONS(MAIN);
DCL P POINTER;
DCL 1 STUD,
2 NAME CHAR(8) INIT('SHAMEEER'),
2 NUM FIXED DECIMAL(3) INIT(4);
/* ALLOCATE STUD;*/
P=ADDR(STUD);
PUT SKIP FILE(SIVA) LIST(STUD.NAME,STUD.NUM);
DCL 1 STUD2 BASED(P),
2 NAME CHAR(8),
2 NUM FIXED DECIMAL(3)INIT(5);
STUD2.NAME = 'WALTER';
/* ALLOCATE STUD2;*/
PUT SKIP FILE(SIVA) LIST(STUD2.NAME,STUD2.NUM);
PUT SKIP FILE(SIVA) LIST(STUD.NAME,STUD.NUM,STUD2.NAME,STUD2.NUM);
END POINT6;

Okay...
Back to top
View user's profile Send private message
shameer007

New User


Joined: 20 Apr 2006
Posts: 13

PostPosted: Fri Aug 18, 2006 8:28 pm    Post subject: Few changes..
Reply with quote

I think it is little bit confusing. I am just commenting some of these lines...



POINT6: PROC OPTIONS(MAIN);
DCL P POINTER;
DCL 1 STUD,
2 NAME CHAR(8) INIT('SHAMEEER'),
2 NUM FIXED DECIMAL(3) INIT(4);
/* ALLOCATE STUD;*/
P=ADDR(STUD);
PUT SKIP FILE(SIVA) LIST(STUD.NAME,STUD.NUM);
DCL 1 STUD2 BASED(P),
2 NAME CHAR(8),
2 NUM FIXED DECIMAL(3)INIT(5);

/* I am commenting this stmt........ */

/* STUD2.NAME = 'WALTER'; */

/* ALLOCATE STUD2;*/

/* here u can give simple PUT SKIP LIST */

/*
PUT SKIP FILE(SIVA) LIST(STUD2.NAME,STUD2.NUM);
PUT SKIP FILE(SIVA) LIST(STUD.NAME,STUD.NUM,STUD2.NAME,STUD2.NUM);
END POINT6; */


PUT SKIP LIST(STUD2.NAME,STUD2.NUM);


Now It is okay I think...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER All times are GMT + 6 Hours
Page 1 of 1