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
 
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: 6968
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: 8165
Location: East Dubuque, Illinois, USA

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: 6968
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 in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm

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