Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How syntax check at Bind time is diff... Poha Eater DB2 5 Wed Mar 21, 2018 9:16 pm
No new posts Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts How to select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 6 Tue Jan 16, 2018 10:49 pm
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us