View previous topic :: View next topic
|
Author |
Message |
d2
New User
Joined: 06 Jan 2021 Posts: 14 Location: INDIA
|
|
|
|
Code: |
Nbr Table Name Row Count Tracks or Cylinders Data Byte count Encoding
--- --------------------------- ---------- ---------- ---------- ------------------- --------
1 DB2XXXX.APLN_DVTM 37 1 1 800 EBCDIC
2 DB2XXXX.BTCH_PROC_TRDYTY_AS 59 1 1 4311 EBCDIC
TZ
3 DB2XXXX.BUS_RBMY_WIR 59 1 1 0 EBCDIC
4 DB2XXXX.CALL_VMYVY 5 1 1 76 EBCDIC
5 DB2XXXX.CALL_FODA 67 1 1 3006 EBCDIC
6 DB2XXXX.CMPLNC_SFBODPTU_PRT 3 1 1 38 EBCDIC
Y
7 DB2XXXX.CMPLNC_SFBODPTU_RUL 320 5 1 111643 EBCDIC
8 DB2XXXX.CMPLNC_ZYTC_FYZ 3231 5 1 200322 EBCDIC
9 DB2XXXX.VPN 11 1 1 352 EBCDIC
10 DB2XXXX.COLL_RAHNAR_DYSY_CD 5 1 1 68 EBCDIC
E
11 DB2XXXX.COLL_AHZ_HPAR_CDE 12 1 1 210 EBCDIC
12 DB2XXXX.COLL_QUYZ_QHZ 109 6 1 21746 EBCDIC
13 DB2XXXX.COLL_QUYZ_QHZ_FRMLA 78 8 1 3608 EBCDIC
14 DB2XXXX.COLL_QUYZ_QHZ_QTZD_ 106 1 1 8798 EBCDIC
TIA
15 DB2XXXX.COLL_QUYZ_QHZ_SCHED 0 1 1 0 EBCDIC
16 DB2XXXX.COLL_QUYZ_QHZ_ETL_P 337 1 1 63019 EBCDIC
ROC
17 DB2XXXX.COLL_TPZ_FHY 0 1 1 0 EBCDIC |
I have a report like above where some of the table names moved to next line.This is generated from a tool. I want it to be in the same line instead of the next line. This is a subset of all the records, I have around 500 records in a single file like this. any help/guidance on this please
Total file length - 133
Nbr - len 3, starts from 1
Table Name - len 27, starts from 8
Row count - len 10, starts from 37
Tracks - len 10, starts from 49
Cylinders - len 10, starts from 61
Data Byte Count - len 19, starts from 73
Encoding - len 8, starts from 94
Expected Output:
Code: |
APLN_DVTM : 37
BTCH_PROC_TRDYTY_ASTZ : 59
BUS_RBMY_WIR : 59
CALL_VMYVY : 5
CALL_FODA : 67
CMPLNC_SFBODPTU_PRTY : 3
CMPLNC_SFBODPTU_RUL : 320
CMPLNC_ZYTC_FYZ : 3231
VPN : 11
COLL_RAHNAR_DYSY_CDE : 5
COLL_AHZ_HPAR_CDE : 12
COLL_QUYZ_QHZ : 109
COLL_QUYZ_QHZ_FRMLA : 78
COLL_QUYZ_QHZ_QTZD_TIA : 106
COLL_QUYZ_QHZ_SCHED : 0
COLL_QUYZ_QHZ_ETL_PROC : 337
COLL_TPZ_FHY : 0 |
Here I am interested in getting the complete table names and the count. The chellange that I am facing is constrcting the complete table names where it got split in two lines. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
What is “total file length”???
What did you try so far?
Where is any sample of used code, and/or received result?
Hints:
- ignore unneeded lines,
- sort by required categories,
- use SECTIONS= parameter to get totals on each category.
TRY TO DO IT YOURSELF, AND ONLY ASK FOR HELP WHEN SOMETHING GOES WRONG.
This is a help forum, not do-my-job-for-me forum. |
|
Back to top |
|
|
d2
New User
Joined: 06 Jan 2021 Posts: 14 Location: INDIA
|
|
|
|
133 is the file length. Using the sort I am able to get all the table names and and count. But truncated table names I am unable to get any logic how to do that. It’s seems very inconsistent to me. I don’t see any logic to group them
So thought of sharing in the forum |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
d2 wrote: |
133 is the file length. Using the sort I am able to get all the table names and and count. But truncated table names I am unable to get any logic how to do that. It’s seems very inconsistent to me. I don’t see any logic to group them
So thought of sharing in the forum |
What is the meaning of FILE LENGTH???????????????????????
There are no “files”. There are “datasets”, each consisting of series of “records”.
In mainframe FILE is equivalent to DDNAME:
//SORTIN DD DSN=SYS.INPUT.DATA
SORTIN - is ddname, aka file name
SYS.INPUT.DATA - is dataset name
TRY TO DO IT YOURSELF, AND ONLY ASK FOR HELP WHEN SOMETHING GOES WRONG.
This is a help forum, not do-my-job-for-me forum. |
|
Back to top |
|
|
d2
New User
Joined: 06 Jan 2021 Posts: 14 Location: INDIA
|
|
|
|
sergeyken wrote: |
What is “total file length”???
What did you try so far?
Where is any sample of used code, and/or received result?
Hints:
- ignore unneeded lines,
- sort by required categories,
- use SECTIONS= parameter to get totals on each category.
TRY TO DO IT YOURSELF, AND ONLY ASK FOR HELP WHEN SOMETHING GOES WRONG.
This is a help forum, not do-my-job-for-me forum. |
Sure I agree thanks for the hints |
|
Back to top |
|
|
d2
New User
Joined: 06 Jan 2021 Posts: 14 Location: INDIA
|
|
|
|
sergeyken wrote: |
d2 wrote: |
133 is the file length. Using the sort I am able to get all the table names and and count. But truncated table names I am unable to get any logic how to do that. It’s seems very inconsistent to me. I don’t see any logic to group them
So thought of sharing in the forum |
What is the meaning of FILE LENGTH???????????????????????
There are no “files”. There are “datasets”, each consisting of series of “records”.
In mainframe FILE is equivalent to DDNAME:
//SORTIN DD DSN=SYS.INPUT.DATA
SORTIN - is ddname, aka file name
SYS.INPUT.DATA - is dataset name
TRY TO DO IT YOURSELF, AND ONLY ASK FOR HELP WHEN SOMETHING GOES WRONG.
This is a help forum, not do-my-job-for-me forum. |
Sorry for the confusion I should have used “dataset”. And the content pasted at the beginning is the content of a dataset having length 133, fixed block. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
OMG!!!!!
133 is your “(logical) record length”, defined via parameter LRECL.
The “length of dataset” may be the total number of records in that dataset.
“Length of dataset” in bytes has no useful meaning, and may be only confusing. |
|
Back to top |
|
|
d2
New User
Joined: 06 Jan 2021 Posts: 14 Location: INDIA
|
|
|
|
Pardon me for this terminology confusion.. hope now the problem statement is understandable. Please suggest any logic I will try to implement that |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
d2 wrote: |
Pardon me for this terminology confusion.. hope now the problem statement is understandable. Please suggest any logic I will try to implement that |
Hints:
- ignore unneeded lines, INCLUDE COND=
- sort by required categories, SORT FIELDS=
- use SECTIONS= parameter to get totals on each category. OUTFIL SECTIONS=
TRY TO DO IT YOURSELF, AND ONLY ASK FOR HELP WHEN SOMETHING GOES WRONG.
This is a help forum, not do-my-job-for-me forum.
P.S.
The idiotic format when ending parts of some category names are split into the next dummy lines - I’d suggest to ignore, until the creator of this idiotic format has fixed his bug. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
You may be able to do using parse delimited by a space and build only second and third field from the parsed data.
However, you can quickly write a cobol program and deliver what’s needed and then work with DFSORT to achieve the same results.
Sample - use space instead of comma in ENDBEFR and use correct lengths.
ibmmainframes.com/about29349.html |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
Rohit Umarjikar wrote: |
You may be able to do using parse delimited by a space and build only second and third field from the parsed data.
However, you can quickly write a cobol program and deliver what’s needed and then work with DFSORT to achieve the same results.
Sample - use space instead of comma in ENDBEFR and use correct lengths.
ibmmainframes.com/about29349.html |
For this particular case, no PARSE of source data is needed; the input is a fixed-columns table. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1334 Location: Bamberg, Germany
|
|
|
|
I also would like to see some kind of activity of what has been tried so far. The solution for this scenario is about ten lines of code.
My output using the hints written earlier in this thread:
Code: |
****** **************************** Datenanfang ****
000001 APLN_DVTM : 37
000002 BTCH_PROC_TRDYTY_ASTZ : 59
000003 BUS_RBMY_WIR : 59
000004 CALL_VMYVY : 5
000005 CALL_FODA : 67
000006 CMPLNC_SFBODPTU_PRTY : 3
000007 CMPLNC_SFBODPTU_RUL : 320
000008 CMPLNC_ZYTC_FYZ : 3231
000009 VPN : 11
000010 COLL_RAHNAR_DYSY_CDE : 5
000011 COLL_AHZ_HPAR_CDE : 12
000012 COLL_QUYZ_QHZ : 109
000013 COLL_QUYZ_QHZ_FRMLA : 78
000014 COLL_QUYZ_QHZ_QTZD_TIA : 106
000015 COLL_QUYZ_QHZ_SCHED : 0
000016 COLL_QUYZ_QHZ_ETL_PROC : 337
000017 COLL_TPZ_FHY : 0
****** **************************** Datenende ****** |
|
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2140 Location: USA
|
|
|
|
Some more hints.
Trying to initiate ANY ACTIVITY at all, besides of "waiting for a gift solution"...
Initial data
Code: |
Nbr Table Name Row Count Tracks or Cylinders Data By
--- --------------------------- ---------- ---------- ---------- ---------
1 DB2XXXX.APLN_DVTM 37 1 1
2 DB2XXXX.BTCH_PROC_TRDYTY_AS 59 1 1
TZ
3 DB2XXXX.BUS_RBMY_WIR 59 1 1
4 DB2XXXX.CALL_VMYVY 5 1 1
5 DB2XXXX.CALL_FODA 67 1 1
6 DB2XXXX.CMPLNC_SFBODPTU_PRT 3 1 1
Y
7 DB2XXXX.CMPLNC_SFBODPTU_RUL 320 5 1
8 DB2XXXX.CMPLNC_ZYTC_FYZ 3231 5 1
9 DB2XXXX.VPN 11 1 1
10 DB2XXXX.COLL_RAHNAR_DYSY_CD 5 1 1
E |
First step of conversion:
Code: |
1 DB2XXXX.APLN_DVTM 37 1 1
2 DB2XXXX.BTCH_PROC_TRDYTY_AS 59 1 1
TZ
3 DB2XXXX.BUS_RBMY_WIR 59 1 1
4 DB2XXXX.CALL_VMYVY 5 1 1
5 DB2XXXX.CALL_FODA 67 1 1
6 DB2XXXX.CMPLNC_SFBODPTU_PRT 3 1 1
Y
7 DB2XXXX.CMPLNC_SFBODPTU_RUL 320 5 1
8 DB2XXXX.CMPLNC_ZYTC_FYZ 3231 5 1
9 DB2XXXX.VPN 11 1 1
10 DB2XXXX.COLL_RAHNAR_DYSY_CD 5 1 1
E |
Second step of conversion:
Code: |
1 DB2XXXX.APLN_DVTM 37 1 1 00000001 APLN_DVTM
2 DB2XXXX.BTCH_PROC_TRDYTY_AS 59 1 1 00000002 BTCH_PROC_TRDYTY_AS
TZ 59 00000002 BTCH_PROC_TRDYTY_AS
3 DB2XXXX.BUS_RBMY_WIR 59 1 1 00000003 BUS_RBMY_WIR
4 DB2XXXX.CALL_VMYVY 5 1 1 00000004 CALL_VMYVY
5 DB2XXXX.CALL_FODA 67 1 1 00000005 CALL_FODA
6 DB2XXXX.CMPLNC_SFBODPTU_PRT 3 1 1 00000006 CMPLNC_SFBODPTU_PRT
Y 3 00000006 CMPLNC_SFBODPTU_PRT
7 DB2XXXX.CMPLNC_SFBODPTU_RUL 320 5 1 00000007 CMPLNC_SFBODPTU_RUL
8 DB2XXXX.CMPLNC_ZYTC_FYZ 3231 5 1 00000008 CMPLNC_ZYTC_FYZ
9 DB2XXXX.VPN 11 1 1 00000009 VPN
10 DB2XXXX.COLL_RAHNAR_DYSY_CD 5 1 1 00000010 COLL_RAHNAR_DYSY_CD
E 5 00000010 COLL_RAHNAR_DYSY_CD |
Third step of conversion:
Code: |
1 DB2XXXX.APLN_DVTM 37 1 1 00000001 APLN_DVTM
2 DB2XXXX.BTCH_PROC_TRDYTY_AS 59 1 1 00000002 BTCH_PROC_TRDYTY_AS
TZ 59 00000002 BTCH_PROC_TRDYTY_ASTZ
3 DB2XXXX.BUS_RBMY_WIR 59 1 1 00000003 BUS_RBMY_WIR
4 DB2XXXX.CALL_VMYVY 5 1 1 00000004 CALL_VMYVY
5 DB2XXXX.CALL_FODA 67 1 1 00000005 CALL_FODA
6 DB2XXXX.CMPLNC_SFBODPTU_PRT 3 1 1 00000006 CMPLNC_SFBODPTU_PRT
Y 3 00000006 CMPLNC_SFBODPTU_PRTY
7 DB2XXXX.CMPLNC_SFBODPTU_RUL 320 5 1 00000007 CMPLNC_SFBODPTU_RUL
8 DB2XXXX.CMPLNC_ZYTC_FYZ 3231 5 1 00000008 CMPLNC_ZYTC_FYZ
9 DB2XXXX.VPN 11 1 1 00000009 VPN
10 DB2XXXX.COLL_RAHNAR_DYSY_CD 5 1 1 00000010 COLL_RAHNAR_DYSY_CD
E 5 00000010 COLL_RAHNAR_DYSY_CDE |
Fourth step of conversion:
Code: |
1 DB2XXXX.APLN_DVTM 37 1 1 00000001 APLN_DVTM
APLN_DVTM : 37
2 DB2XXXX.BTCH_PROC_TRDYTY_AS 59 1 1 00000002 BTCH_PROC_TRDYTY_AS
TZ 59 00000002 BTCH_PROC_TRDYTY_ASTZ
BTCH_PROC_TRDYTY_ASTZ : 59
3 DB2XXXX.BUS_RBMY_WIR 59 1 1 00000003 BUS_RBMY_WIR
BUS_RBMY_WIR : 59
4 DB2XXXX.CALL_VMYVY 5 1 1 00000004 CALL_VMYVY
CALL_VMYVY : 5
5 DB2XXXX.CALL_FODA 67 1 1 00000005 CALL_FODA
CALL_FODA : 67
6 DB2XXXX.CMPLNC_SFBODPTU_PRT 3 1 1 00000006 CMPLNC_SFBODPTU_PRT
Y 3 00000006 CMPLNC_SFBODPTU_PRTY
CMPLNC_SFBODPTU_PRTY : 3
7 DB2XXXX.CMPLNC_SFBODPTU_RUL 320 5 1 00000007 CMPLNC_SFBODPTU_RUL
CMPLNC_SFBODPTU_RUL : 320
8 DB2XXXX.CMPLNC_ZYTC_FYZ 3231 5 1 00000008 CMPLNC_ZYTC_FYZ
CMPLNC_ZYTC_FYZ : 3231
9 DB2XXXX.VPN 11 1 1 00000009 VPN
VPN : 11
10 DB2XXXX.COLL_RAHNAR_DYSY_CD 5 1 1 00000010 COLL_RAHNAR_DYSY_CD
E 5 00000010 COLL_RAHNAR_DYSY_CDE |
Fifth step of conversion:
Code: |
APLN_DVTM : 37
BTCH_PROC_TRDYTY_ASTZ : 59
BUS_RBMY_WIR : 59
CALL_VMYVY : 5
CALL_FODA : 67
CMPLNC_SFBODPTU_PRTY : 3
CMPLNC_SFBODPTU_RUL : 320
CMPLNC_ZYTC_FYZ : 3231
VPN : 11
COLL_RAHNAR_DYSY_CDE : 5
COLL_AHZ_HPAR_CDE : 12
COLL_QUYZ_QHZ : 109
COLL_QUYZ_QHZ_FRMLA : 78
COLL_QUYZ_QHZ_QTZD_TIA : 106
COLL_QUYZ_QHZ_SCHED : 0
COLL_QUYZ_QHZ_ETL_PROC : 337
COLL_TPZ_FHY : 0 |
|
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1744 Location: Tirupur, India
|
|
|
|
Great illustration - sergeyken. Thank you |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1334 Location: Bamberg, Germany
|
|
|
|
The additional section identifier at the end is not really needed. It can be pushed the same way as the amount column. To demonstrate what must be done to solve the requirement, I agree. |
|
Back to top |
|
|
|