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
 
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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