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
 

 

Redefines copybook for multiple layout records

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

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Tue Jun 10, 2008 1:36 pm    Post subject: Redefines copybook for multiple layout records
Reply with quote

Hi, i have the following requirement.

I am having a following input file, with different layout records

10001abcdefghij25
1000275abcdefghij
10001abcdefghij45
1000255abcdefghij
10001abcdefghij55
1000245abcdefghij
10001abcdefghij65
1000235abcdefghij

The record start with 10001 is first detail record and the one start with 10002 is second detail records,
both are having different layout, eXcept id num field is same.

first Records(10001) have following fields
id num 9(5)
name x(10)
age x(02)
filler x(63).

second Records(10002) have following fields(age and name are changed)
id num 9(5)
age x(02)
name x(10)
filler x(63).

input file length is 80.

i want to create a copybook as member to view the above the file in
file Aid. i don't want to use this copybook in program , i just need this copybook for viewing the file for some report purpose.

i created a copybook, but i am getting error, can u please correct this or give the exact copybook such

if id num is 10001,it should use first record layout and displays in file aid.
similarly for id num is 10002, it should use second record layout.

i used the copybook, it shows all the records in all layout.
05 WS-RECORD.
10 ID-NUM PIC 9(5).
10 REM-FIELDS PIC X(75).
10 RECORD1 REDEFINES REM-FIELDS.
15 NAME1 PIC X(10).
15 AGE1 PIC X(02).
15 FILLER PIC X(63).
10 RECORD2 REDEFINES REM-FIELDS.
15 AGE2 PIC X(02).
15 NAME2 PIC X(10).
15 FILLER PIC X(63).

please provide the exact copybook.
Back to top
View user's profile Send private message

Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jun 10, 2008 3:39 pm    Post subject:
Reply with quote

Your copybook works for me in file-aid for the data given by you.

Hope you have coded the fields in the copybook from position 8 and not before it?
Back to top
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Tue Jun 10, 2008 4:25 pm    Post subject:
Reply with quote

Hi,
When I use the following copybook, i am able to see the records in File aid.
05 WS-RECORD.
10 ID-NUM PIC 9(5).
10 REM-FIELDS PIC X(75).
10 RECORD1 REDEFINES REM-FIELDS.
15 NAME1 PIC X(10).
15 AGE1 PIC X(02).
15 FILLER PIC X(63).
10 RECORD2 REDEFINES REM-FIELDS.
15 AGE2 PIC X(02).
15 NAME2 PIC X(10).
15 FILLER PIC X(63).

But, Record is displayed for both the layouts....Actually it should be displayed for one layout Right? if id num is 10001, first layout alone should be used and if id num is 10002 second layout alone shoudl be used.
How to acheive this?... i am getting both the outputs as following in File aid.


RECORD: 1 WS-RECORD
---- FIELD LEVEL/NAME ------- -FORMAT- ----+----1----
5 WS-RECORD 80/GRP
10 ID-NUM 5/NUM 10001
10 REM-FIELDS 75/AN abcdefghij25
(POS 41-75)
10 RECORD1 REDEFINES REM-FIELDS
10 RECORD1 75/GRP
15 NAME1 10/AN abcdefghij
15 AGE1 2/AN 25
15 FILLER 63/AN
( POS 41-63)
10 RECORD2 REDEFINES REM-FIELDS
10 RECORD2 75/GRP
15 AGE2 2/AN ab
15 NAME2 10/AN cdefghij25
15 FILLER 63/AN
(POS 41-63)

How to view the records in a particualar layout alone.?

thanks
Sankar
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Tue Jun 10, 2008 4:37 pm    Post subject:
Reply with quote

sankar_MF wrote:
Hi,
When I use the following copybook, i am able to see the records in File aid.
05 WS-RECORD.
10 ID-NUM PIC 9(5).
10 REM-FIELDS PIC X(75).
10 RECORD1 REDEFINES REM-FIELDS.
15 NAME1 PIC X(10).
15 AGE1 PIC X(02).
15 FILLER PIC X(63).
10 RECORD2 REDEFINES REM-FIELDS.
15 AGE2 PIC X(02).
15 NAME2 PIC X(10).
15 FILLER PIC X(63).

But, Record is displayed for both the layouts....Actually it should be displayed for one layout Right? if id num is 10001, first layout alone should be used and if id num is 10002 second layout alone shoudl be used.
How to acheive this?... i am getting both the outputs as following in File aid.


RECORD: 1 WS-RECORD
---- FIELD LEVEL/NAME ------- -FORMAT- ----+----1----
5 WS-RECORD 80/GRP
10 ID-NUM 5/NUM 10001
10 REM-FIELDS 75/AN abcdefghij25
(POS 41-75)
10 RECORD1 REDEFINES REM-FIELDS
10 RECORD1 75/GRP
15 NAME1 10/AN abcdefghij
15 AGE1 2/AN 25
15 FILLER 63/AN
( POS 41-63)
10 RECORD2 REDEFINES REM-FIELDS
10 RECORD2 75/GRP
15 AGE2 2/AN ab
15 NAME2 10/AN cdefghij25
15 FILLER 63/AN
(POS 41-63)

How to view the records in a particualar layout alone.?

thanks
Sankar


AFAIK in file-aid you cannot split the record types based on your requirements. You just redefine the record with different record types and view/use the suitable fields. File-aid or any file utility for that matter displays the records based on your copybook and fills all the fields of the copybook
Back to top
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Tue Jun 10, 2008 5:36 pm    Post subject:
Reply with quote

Hi Manu,
Thanks for your reply.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Fri Jun 13, 2008 12:41 am    Post subject:
Reply with quote

Did you try creating XREF for file-aid here?
I think creating an XREF will perfectly fulfil your requirement.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Fri Jun 13, 2008 12:45 am    Post subject:
Reply with quote

Quote:
File-aid or any file utility for that matter displays the records based on your copybook and fills all the fields of the copybook

If your statement was true then companies will be wasting all their money in products like FILE-AID. FILE-AID can do much more than that.
Back to top
View user's profile Send private message
ashimer

Active Member


Joined: 13 Feb 2004
Posts: 551
Location: Bangalore

PostPosted: Fri Jun 13, 2008 8:44 am    Post subject:
Reply with quote

As abhijit stated define 2 xref's for the record layouts you want and mention the starting position for each layout
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 Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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