IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need the syntax of 'BASED' used in PL/1 pgms


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
spriya

New User


Joined: 06 Oct 2005
Posts: 42

PostPosted: Tue Jul 25, 2006 12:32 pm
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
shameer007

New User


Joined: 20 Apr 2006
Posts: 12

PostPosted: Fri Aug 18, 2006 8:20 pm
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: 12

PostPosted: Fri Aug 18, 2006 8:28 pm
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
No new posts Split large FB file based on Key coun... DFSORT/ICETOOL 4
No new posts Mass JCL release via IDZ tool(eclipse... CA Products 1
Search our Forums:

Back to Top