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

why REORDER is used in PL/1


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

New User


Joined: 04 Jul 2006
Posts: 6

PostPosted: Tue Aug 29, 2006 1:51 pm
Reply with quote

PLZ GIVE THE REASON..

why REORDER is used inthe pl/1 coding..
Back to top
View user's profile Send private message
Kodisala

New User


Joined: 13 Apr 2005
Posts: 5
Location: Hyderabad

PostPosted: Wed Aug 30, 2006 5:10 pm
Reply with quote

REORDER is one of the optimization options that are specified for a procedure or begin-block. The REORDER option allows the compiler to generate optimized code to produce the result specified by the source program when error-free execution takes place.
Back to top
View user's profile Send private message
mahaes

New User


Joined: 04 Jul 2006
Posts: 6

PostPosted: Thu Aug 31, 2006 11:15 am
Reply with quote

hi, i didnt understand clearly from these lines....

can u explain little bit clear...

plz..
Back to top
View user's profile Send private message
rskumar

New User


Joined: 21 Nov 2005
Posts: 35
Location: chennai

PostPosted: Thu Aug 31, 2006 12:57 pm
Reply with quote

hi Mahesh,

REORDER keyword in PL/I is similar to the Defragmentation process that u carry on in WINDOWS OS. The unused space in between the arrays, variables etc get removed and the entire space is available for us to store data.

whenever v see the space in a drive in windows, the system specifies the free space it has but when u try to copy a file to that space of the specified size, you will get an error msg. meaning: the system shows you the unused space by the applications but not the end space in the hard disk. Disk Defragmentation just reorders the space, or reshuffles the space and makes the entire unused space available for us.

hope this is clear for you.

rskumar :-)
Back to top
View user's profile Send private message
mahaes

New User


Joined: 04 Jul 2006
Posts: 6

PostPosted: Mon Sep 04, 2006 9:57 am
Reply with quote

thanks kumar for explaining the concept in a very clear manner.....
Back to top
View user's profile Send private message
MCEVOY

New User


Joined: 21 Nov 2005
Posts: 18

PostPosted: Mon Sep 04, 2006 2:10 pm
Reply with quote

I think you will find that the main purpose of the REORDER option is to allow the optimising compiler to change the sequence of operations from what the programmer has coded to a more efficient way of arriving at the same result.
For example, unnecessary repetition of assignments within DO loops can be avoided by moving the assignment outside the loops.
If you don't code REORDER, then ORDER applies by default.
I always code REORDER as I can never think of a reason not to.
Back to top
View user's profile Send private message
kunasatheesh

New User


Joined: 27 Sep 2007
Posts: 6
Location: Hyderabad India

PostPosted: Wed Jul 22, 2009 5:06 pm
Reply with quote

Thanks for question as well as for answer...good one ..
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jul 22, 2009 6:45 pm
Reply with quote

Quote:
REORDER keyword in PL/I is similar to the Defragmentation process that u carry on in WINDOWS OS. The unused space in between the arrays, variables etc get removed and the entire space is available for us to store data.


could not be more wrong ...
please post the link where You found such a wrong definition
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jul 22, 2009 7:16 pm
Reply with quote

follow on...
what is wrong in looking at the manuals ( for example )
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IBMSH350
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Jul 23, 2009 5:12 am
Reply with quote

And apparently that completely wrong answer has been out there for almost 3 years
Back to top
View user's profile Send private message
kunasatheesh

New User


Joined: 27 Sep 2007
Posts: 6
Location: Hyderabad India

PostPosted: Thu Jul 23, 2009 10:03 am
Reply with quote

Hi Enrico,

If you know the answer please post it, i m unable to find in that link. Please post it.

Hi Babu,

If you know correct answer please post it.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 23, 2009 1:03 pm
Reply with quote

Quote:
And apparently that completely wrong answer has been out there for almost 3 years


it happens icon_biggrin.gif

when I see that a topic has been updated I just look at the date of the last post, and after I scroll backwards to see what has been going on
( I forget to check the dates sometimes )
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Jul 23, 2009 1:27 pm
Reply with quote

Quote:
unable to find in that link

freshen up Your searching and reading skills for manuals

start from
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IBMSH350
click on ( Search Documents ), will get You to
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IBMSH350?filter=&SEARCHBS=Search+Documents
in the search box type reorder and click on (Search), will get You to
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IBMSH350?searchRequest=reorder&SEARCH=Search&Type=FUZZY&SearchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK

click on the programming reference link and the programming guide
it will tell the (RE)order effects

the (RE)order option is a bit misleading in its wording
PL/I when optimizing will allways shuffle code around ( like taking things out of loops )
as long as there are no side effects ( see order/reorder issues )

for example write a stupid program with

Code:
dcl 1 structa ,
    2 field1a ...
    2 field2a ...
    2 field3a ... ;
dcl 1 structb ,
    2 field1b ...
    2 field2b ...
    2 field3b ... ;

make sure that the fieldxa and fieldxb are defined in the same way

play around moving fields from one structure to the other one in different order

Code:
field1a = field1b
field2a = field2b
field3a = field3b


if You have the compiler generate the assembler listing
You will see what happens with different optimizations

if the data type are the same PL/1 will use simple MVC machine instructions

and ( unless the compiler has become suddenly stupid ) for the assignments above it should use one and only one MVC instruction

and if You carry on the assignments in reverse order PL/1 will anyway realize that the fields are contiguous components of structures
and use ..... one simple MVC

I'll try to test it later on and post exhaustive results
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Jul 23, 2009 7:40 pm
Reply with quote

Some compilers use REORDER to indicate that the compiler can reorder assembler instructions to take advantage of the fetch/decode/execute pipeline in the hardware. For example, it might specially order instructions that don't use the same registers so they can run through the pipeline without conflicts and delays. Some modern hardware implements out of order execution to try to do the same thing. Does PL/I do that optimization with REORDER? The doc seemed vague but implied this might be the case.
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 reorder screeNS using SWAP LIST? TSO/ISPF 5
No new posts Function of the parameter REORDER in ... PL/I & Assembler 2
No new posts Doubt in PL/1 - About Reorder Option PL/I & Assembler 1
Search our Forums:

Back to Top