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
 

 

Difference Between "OCCURS N TIMES PIC X" and &quo

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Maddipatla Rajasekhar

New User


Joined: 10 Mar 2009
Posts: 16
Location: Hyderabad

PostPosted: Tue Jul 14, 2009 11:29 am    Post subject: Difference Between "OCCURS N TIMES PIC X" and &quo
Reply with quote

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
View user's profile Send private message

Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Tue Jul 14, 2009 11:51 am    Post subject:
Reply with quote

Hi Raj,

As per my knowledge i dont think there is any difference though i would prefer the second one as its simpler... icon_razz.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Jul 14, 2009 12:49 pm    Post subject:
Reply with quote

Quote:
which is the best in performance wise and how


performance of what?
Back to top
View user's profile Send private message
Maddipatla Rajasekhar

New User


Joined: 10 Mar 2009
Posts: 16
Location: Hyderabad

PostPosted: Tue Jul 14, 2009 1:20 pm    Post subject:
Reply with quote

Performance in terms of processing time
Back to top
View user's profile Send private message
Maddipatla Rajasekhar

New User


Joined: 10 Mar 2009
Posts: 16
Location: Hyderabad

PostPosted: Tue Jul 14, 2009 1:29 pm    Post subject: Reply to: Difference Between "OCCURS N TIMES PIC X"
Reply with quote

Hi Binop,

Thanks for ur reply.. icon_smile.gif

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7996
Location: Bellevue, IA

PostPosted: Tue Jul 14, 2009 3:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Maddipatla Rajasekhar

New User


Joined: 10 Mar 2009
Posts: 16
Location: Hyderabad

PostPosted: Tue Jul 14, 2009 3:25 pm    Post subject: Reply to: Difference Between "OCCURS N TIMES PIC X"
Reply with quote

Hi Donald,

Thank you so much for ur answer.. icon_smile.gif
Back to top
View user's profile Send private message
Thangaprabhu

New User


Joined: 15 Jul 2009
Posts: 16
Location: INDIA

PostPosted: Fri Jul 17, 2009 6:46 pm    Post subject: Hi..
Reply with quote

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
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Fri Jul 17, 2009 6:49 pm    Post subject:
Reply with quote

Also its costly to initialize FIELD1.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 17, 2009 8:03 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm


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