Hi,
My Input file's records look like this....
2007,ABINGDON EXTRA ,,,,Compass,,,,,,,,,,,,,,,,,,,,,,,,,,,,2005/34,
2008,ABINGDON EXTRA ,,,,Compass,,,,,,,,,,,,,,,,,,,,,,,,,,,,2005/30,
2017,ADDLESTONE ,,,,Avenance,,,,,,,,,,,,,,,,,,,,,,,,,,,,2006/26,
2019,ALTRINCHAM EXTRA ,,,,Compass,,,,,,,,,,,,,,,,,,,,,,,,,,,,2005/30,
2020,AMERSHAM ,,,,Avenance,,,,,,,,,,,,,,,,,,,,,,,,,,,,2005/30,
2021,AMMANFORD ,,,,tbc,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
2022,ALLERTON ROAD ,,,,tbc,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
2025,ALDERSHOT ,,,,Avenance,,,,,,,,,,,,,,,,,,,,,,,,,,,,2005/34,
I want to retrieve data that is at the end of each record (eg. 2005/34)
but this is not in the same coloum in all the records(,,,2005/30)..... how do i retrieve.??
Note: the input file does not have a copy layout.
It is just Input-File OCCURS 2000 times
VARIABLE-NAME PIC(X)
This makes it more confusing.
Is there some other way other than easytrieve??
Pls help........
Data formating in Easytrieve
Moderators: DikDude, Moderator Group
There are few questions I want to ask you before I provider any solution. But I will try to give some pointers by using which you might achieve want you want to.
It is just Input-File OCCURS 2000 times
VARIABLE-NAME PIC(X)
2007,ABINGDON EXTRA ,,,,Compass,,,,,,,,,,,,,,,,,,,,,,,,,,,,2005/34,
2008,ABINGDON EXTRA ,,,,Compass,,,,,,,,,,,,,2005/30,
If I understand the question right.
Irrespective of the length of the record, you want to extract the last ?7? bytes of data from each record.
From the definition of the file you have mentioned. I assume we can reference each byte of the file using an INDEX VARIABLE-NAME (INDEX) which is nothing but
VARIABLE-NAME (1)
VARIABLE-NAME (2)
??????????????.
VARIABLE-NAME (2000)
If the file layout had num-of-occurrences of each byte, which is nothing but the length of the file it would have been very straight forward.
There is something called as RECORD-LENGTH in EZT using which we can get the length of each record.
Syntax: OUTFILEB: RECORD-LENGTH
OUTFILEB (DD name of the input file)
Assign the length of each record to a working storage variable.
Now, if we have lengths of each record say 1700 for rec1 and 1600 rec2.
Start extracting data rec1, from 1694 (I assume that you need to extract last 7 bytes)
Start extracting data rec2, from 1594 (I assume that you need to extract last 7 bytes)
VARIABLE-NAME (1594)
VARIABLE-NAME (1595)
.....so on
You should able to extract what you need.
OTHER OPTION
If the assignments of the length of the record do not work then you need to load the data into some internal table until you hit the end of the record and get the length of each record and the rest of the process is same as mentioned above.
Hope this helps.
If both the ways do not work, post your question in DFSORT. Make sure you provide full details like FILE LRECL, FORMAT, input snap shot of data and the expected results with detailed examples, Frank will be able to help you if there is a way in DFSORT to do this.
Thanks,
Veera.
It is just Input-File OCCURS 2000 times
VARIABLE-NAME PIC(X)
2007,ABINGDON EXTRA ,,,,Compass,,,,,,,,,,,,,,,,,,,,,,,,,,,,2005/34,
2008,ABINGDON EXTRA ,,,,Compass,,,,,,,,,,,,,2005/30,
If I understand the question right.
Irrespective of the length of the record, you want to extract the last ?7? bytes of data from each record.
From the definition of the file you have mentioned. I assume we can reference each byte of the file using an INDEX VARIABLE-NAME (INDEX) which is nothing but
VARIABLE-NAME (1)
VARIABLE-NAME (2)
??????????????.
VARIABLE-NAME (2000)
If the file layout had num-of-occurrences of each byte, which is nothing but the length of the file it would have been very straight forward.
There is something called as RECORD-LENGTH in EZT using which we can get the length of each record.
Syntax: OUTFILEB: RECORD-LENGTH
OUTFILEB (DD name of the input file)
Assign the length of each record to a working storage variable.
Now, if we have lengths of each record say 1700 for rec1 and 1600 rec2.
Start extracting data rec1, from 1694 (I assume that you need to extract last 7 bytes)
Start extracting data rec2, from 1594 (I assume that you need to extract last 7 bytes)
VARIABLE-NAME (1594)
VARIABLE-NAME (1595)
.....so on
You should able to extract what you need.
OTHER OPTION
If the assignments of the length of the record do not work then you need to load the data into some internal table until you hit the end of the record and get the length of each record and the rest of the process is same as mentioned above.
Hope this helps.
If both the ways do not work, post your question in DFSORT. Make sure you provide full details like FILE LRECL, FORMAT, input snap shot of data and the expected results with detailed examples, Frank will be able to help you if there is a way in DFSORT to do this.
Thanks,
Veera.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page