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
 

 

Occurs clause in file section.

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

New User


Joined: 20 Apr 2005
Posts: 9
Location: Chennai

PostPosted: Thu Jun 16, 2005 10:58 am    Post subject: Occurs clause in file section.
Reply with quote

Can we have occurs clause in file setion.

Regards,
Prema
Back to top
View user's profile Send private message

sangiah

New User


Joined: 10 Jun 2005
Posts: 62

PostPosted: Thu Jun 16, 2005 11:08 am    Post subject: Re: Occurs clause in file section.
Reply with quote

you can have occurs clause in file section.
Back to top
View user's profile Send private message
sudheer648

New User


Joined: 23 May 2005
Posts: 97
Location: Chennai

PostPosted: Thu Jun 16, 2005 3:07 pm    Post subject: Re: Occurs clause in file section.
Reply with quote

Hi subbprem,

You mean using occurs in structure you define for the file.(FD)

If it so definetly you cannot use occurs clause.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Jun 16, 2005 3:43 pm    Post subject:
Reply with quote

I'm in accord with sudheer.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Jun 17, 2005 7:24 am    Post subject:
Reply with quote

Can someone give an explanation of why not?
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Jun 17, 2005 3:20 pm    Post subject:
Reply with quote

In my experience, but I'm not a great COBOL programmer, I nerver saw occurs definition in file section but only redefines because in this part of Data Division (I was thinking)you can only define the structure(with redefins) of your files defined in FD.
But the COBOL manual tell us that Occurs clause can be inserted in Data Division in the "section" of the Data Description Entry as you can see from the link below:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGYL1101/2.5.1.1?SHELF=&DT=19930312093006&CASE=
But you cannot use in this phase the levels: 01,66,77,88
Below the link of restrictions:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGYL1101/2.7.6?SHELF=&DT=19930312093006&CASE=
After a search in "my" old program I saw some utilization of occurs in FS and after these rows of explaination I can apoligize because in my post above i was wrong.

Thanks Jack!
Back to top
View user's profile Send private message
ravindra mudumby

New User


Joined: 16 Jun 2005
Posts: 6
Location: blore

PostPosted: Sat Jun 18, 2005 12:31 am    Post subject: ravindra mudumby
Reply with quote

my view about this whole thing
OCCURS clause When specified for an item within the scope of an OCCURS clause, each occurrence of the item is synchronized.
DISPLAY or PACKED-DECIMAL Each item is syntax checked, but the SYNCHRONIZED clause has no effect on execution.
NATIONAL Each item is syntax checked, but the SYNCHRONIZED clause has no effect on execution.
BINARY or COMPUTATIONAL When the item is the first elementary item subordinate to an item that contains a REDEFINES clause, the item must not require the addition of unused character positions.

When the synchronized clause is not specified for a subordinate data item (one with a level number of 02 through 49):

* The item is aligned at a displacement that is a multiple of 2 relative to the beginning of the record if its USAGE is BINARY and its PICTURE is in the range of S9 through S9(4).
* The item is aligned at a displacement that is a multiple of 4 relative to the beginning of the record if its USAGE is BINARY and its PICTURE is in the range of S9(5) through S9(18), or its USAGE is INDEX.

When SYNCHRONIZED is not specified for binary items, no space is reserved for slack bytes.
POINTER, PROCEDURE-POINTER, FUNCTION-POINTER, OBJECT REFERENCE The data is aligned on a fullword boundary.
COMPUTATIONAL-1 The data is aligned on a fullword boundary.
COMPUTATIONAL-2 The data is aligned on a doubleword boundary.
COMPUTATIONAL-3 The data is treated the same as the SYNCHRONIZED clause for a PACKED-DECIMAL item.
COMPUTATIONAL-4 The data is treated the same as the SYNCHRONIZED clause for a COMPUTATIONAL item.
COMPUTATIONAL-5 The data is treated the same as the SYNCHRONIZED clause for a COMPUTATIONAL item.
DBCS and external floating-point item Each item is syntax checked, but the SYNCHRONIZED clause has no effect on execution.
REDEFINES clause For an item that contains a REDEFINES clause, the data item that is redefined must have the proper boundary alignment for the data item that redefines it. For example, if you write the following, be sure that data item A begins on a fullword boundary:

02 A PICTURE X(4).
02 B REDEFINES A PICTURE S9(9) BINARY SYNC.

In the file section, the compiler assumes that all level-01 records that contain SYNCHRONIZED items are aligned on doubleword boundaries in the buffer. You must provide the necessary slack bytes between records to ensure alignment when there are multiple records in a block.

In the working-storage section, the compiler aligns all level-01 entries on a doubleword boundary.

For the purposes of aligning binary items in the linkage section, all level-01 items are assumed to begin on doubleword boundaries. Therefore, if you issue a CALL statement, such operands of any USING phrase within it must be aligned correspondingly.
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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


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