IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need help on formatting a report


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
d2

New User


Joined: 06 Jan 2021
Posts: 14
Location: INDIA

PostPosted: Sat Jun 24, 2023 12:50 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Sat Jun 24, 2023 6:18 pm
Reply with quote

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
View user's profile Send private message
d2

New User


Joined: 06 Jan 2021
Posts: 14
Location: INDIA

PostPosted: Sat Jun 24, 2023 6:20 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Sat Jun 24, 2023 6:24 pm
Reply with quote

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
View user's profile Send private message
d2

New User


Joined: 06 Jan 2021
Posts: 14
Location: INDIA

PostPosted: Sat Jun 24, 2023 6:31 pm
Reply with quote

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
View user's profile Send private message
d2

New User


Joined: 06 Jan 2021
Posts: 14
Location: INDIA

PostPosted: Sat Jun 24, 2023 6:42 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Sat Jun 24, 2023 6:45 pm
Reply with quote

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
View user's profile Send private message
d2

New User


Joined: 06 Jan 2021
Posts: 14
Location: INDIA

PostPosted: Sat Jun 24, 2023 8:06 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Sat Jun 24, 2023 8:17 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Sun Jun 25, 2023 6:27 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Mon Jun 26, 2023 1:09 am
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Mon Jun 26, 2023 11:52 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Mon Jun 26, 2023 9:12 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Jun 27, 2023 6:30 pm
Reply with quote

Great illustration - sergeyken. Thank you
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Tue Jun 27, 2023 7:16 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts Rexx formatting CLIST & REXX 2
No new posts Ca7 long running jobs report All Other Mainframe Topics 1
No new posts Report of batch jobs JCL & VSAM 1
No new posts z/OS Modules Usage report using SMF 42 DFSORT/ICETOOL 2
Search our Forums:

Back to Top