Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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    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

shameer007

New User


Joined: 20 Apr 2006
Posts: 12

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: 12

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
This topic is locked: you cannot edit posts or make replies. Job to wait and continue based on reply yugendran COBOL Programming 5 Wed Oct 05, 2016 1:46 pm
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us