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
 

 

File Section variable definition

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

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Mon Nov 12, 2007 8:32 pm    Post subject: File Section variable definition
Reply with quote

I have defined my file section entry like this.

FD FBPFILE-FILE
RECORD CONTAINS 6000 CHARACTERS
BLOCK CONTAINS 0 RECORDS
RECORDING MODE IS F.
01 FBPFILE-CASE-REC-AREA PIC X(6000).
COPY PTUBFPCR.

The copybook PTUBFPCR has its own 01 variable.

My question is that - When I read file into FBPFILE-CASE-REC-AREA variable, the copybook is also populated. I am not sure why this is happening because FBPFILE-CASE-REC-AREA and 01 variable of the copybook are 2 entirely different variables.
Back to top
View user's profile Send private message

mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Nov 12, 2007 9:09 pm    Post subject:
Reply with quote

Hey Jude,

The 01 levels in an FD are treated as redefs of each other, so if you READ INTO either 01, it uses the same area of the file buffer and any lower level variable of either 01 can be referenced from the PD.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Nov 12, 2007 11:32 pm    Post subject: Re: File Section variable definition
Reply with quote

niks_jude wrote:
I have defined my file section entry like this.

01 FBPFILE-CASE-REC-AREA PIC X(6000).
COPY PTUBFPCR.

The copybook PTUBFPCR has its own 01 variable.

My question is that - When I read file into FBPFILE-CASE-REC-AREA variable, the copybook is also populated. I am not sure why this is happening because FBPFILE-CASE-REC-AREA and 01 variable of the copybook are 2 entirely different variables.


That is standard COBOL processing.
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Tue Nov 13, 2007 8:54 am    Post subject:
Reply with quote

Hi jude

Quote:
When I read file into FBPFILE-CASE-REC-AREA variable, the copybook is also populated. I am not sure why this is happening because FBPFILE-CASE-REC-AREA and 01 variable of the copybook are 2 entirely different variables


This is because, The 01 Variables in FILE SECTION is treated as REDEFINING Items

say

01 WS-GROUP-1 PIC X(80)
01 WS-GROUP-2 PIC X(50)

WHICH INTERNALLY REDEFINED

Ie WS-GROUP-2 REDEFINES WS-GROUP-1 AND WS-GROUP-2 WILL HAVE A VALUE OF WS-GROUP-1 TILL 50 BYTES..
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Nov 13, 2007 11:25 am    Post subject:
Reply with quote

That answers my question. Thank you.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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