View previous topic :: View next topic
|
Author |
Message |
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
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 |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
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 |
|
|
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
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 |
|
|
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 115 Location: Chennai
|
|
|
|
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 |
|
|
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
Hi Manu,
Thanks for your reply. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Did you try creating XREF for file-aid here?
I think creating an XREF will perfectly fulfil your requirement. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
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 |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
As abhijit stated define 2 xref's for the record layouts you want and mention the starting position for each layout |
|
Back to top |
|
|
|