View previous topic :: View next topic
|
Author |
Message |
Maddipatla Rajasekhar
New User
Joined: 10 Mar 2009 Posts: 16 Location: Hyderabad
|
|
|
|
Hi!
1) what is the difference between "FILLER OCCURS N TIMES PIC X" AND "FILLER PIC X(N)"
2)If there is a difference which is the best in performance wise and how? |
|
Back to top |
|
|
Binop B
Active User
Joined: 18 Jun 2009 Posts: 407 Location: Nashville, TN
|
|
|
|
Hi Raj,
As per my knowledge i dont think there is any difference though i would prefer the second one as its simpler... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
which is the best in performance wise and how |
performance of what? |
|
Back to top |
|
|
Maddipatla Rajasekhar
New User
Joined: 10 Mar 2009 Posts: 16 Location: Hyderabad
|
|
|
|
Performance in terms of processing time |
|
Back to top |
|
|
Maddipatla Rajasekhar
New User
Joined: 10 Mar 2009 Posts: 16 Location: Hyderabad
|
|
|
|
Hi Binop,
Thanks for ur reply..
Just now i get the answer for my query thru my analysis, the diff is that if we code "filler occurs n times pic x" then 'n' single byte fields will be allocated individually with field name 'filler' every time, if we code pic x(n) then continuous n bytes will be allocated with single field name filler. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Performance will be the same in either case -- FILLER items are defined at compile time; they're not used at run-time since they, by definition, do not contain data that your program can reference.
You might eat up a small fraction more time during the compile if you have lots and lots of FILLER OCCURS clauses, but once the compile is done the executing code is what matters. |
|
Back to top |
|
|
Maddipatla Rajasekhar
New User
Joined: 10 Mar 2009 Posts: 16 Location: Hyderabad
|
|
|
|
Hi Donald,
Thank you so much for ur answer.. |
|
Back to top |
|
|
Thangaprabhu
New User
Joined: 15 Jul 2009 Posts: 16 Location: INDIA
|
|
|
|
The major difference is
there are two fields
FIELD1 declared as occurs n times PIC X
FIELD2 declared as PIC X(N).
if u want to find the Nth element in FIELD1 u should use subscripts
eg:- DISPLAY FIELD1(N) will display Nth element
if u want to find the Nth element in FIELD2 u should use Reference modification
eg:- DISPLAY FIELD2(N:1) will display Nth element |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
Also its costly to initialize FIELD1. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Thangaprabhu wrote: |
u should use subscripts |
the effecient method is by indexing.
subscripts are slower than indexing.
PIC s9(n) or pic 9(n)
is not as effecient as pic s9(n) comp. |
|
Back to top |
|
|
|