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

Join lines with dfsort


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

New User


Joined: 30 Jun 2005
Posts: 37
Location: Germany

PostPosted: Mon Oct 05, 2020 12:16 pm
Reply with quote

I have data output where i have a key field and would like to join the lines.
Data is:
Code:

 ***** d72mxV122 *****                                                 16:44 Friday, October 2, 2020   1     
                                                                                                           
  Obs    SYSTEM    SRVCLASS    appl            date         hms          DURATM    dursecs                 
                                                                                                           
    1     QXG0     ASWPO301    ASW         20-09-28     0:00:00      0:15:00.00    899.995                 
    2     QXG0     ATAPO301    ATA         20-09-28     0:00:00      0:15:00.00    899.995     
...
Obs           CPUTM      CPUUNITS      SERVICE    cpupcen    cpupcent       
                                                                             
  1      0:00:00.02       1337.39        18218    0.00092     0.00025       
  2      0:00:01.63      87268.43      2064411    0.06020     0.01655       

..


Output:

Code:

Obs    SYSTEM     SRVCLASS    appl       date          hms          DURATM        dursecs         CPUTM          CPUUNITS      SERVICE    cpupcen  cpupcent                             
   1     QXG0     ASWPO301    ASW         20-09-28     0:00:00      0:15:00.00    899.995         0:00:00.02     1337.39       18218      0.00092  0.00025     
...


Thank you very much.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Oct 05, 2020 4:49 pm
Reply with quote

This looks like a report...if it is:
1) how many lines to a page?
2) are there headings on every page?
3) is that first line in your dataset the only time this line type appears?
4) If not is it always to be ignored?

or is the data one line (to be ignored), one heading line and any number of data lines?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Tue Oct 06, 2020 1:08 am
Reply with quote

kushkush wrote:
I have data output where i have a key field and would like to join the lines.

What is the, yet unknown, key field?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2019
Location: USA

PostPosted: Tue Oct 06, 2020 2:35 am
Reply with quote

kushkush wrote:
I have data output where i have a key field and would like to join the lines.
Data is:
Code:

 ***** d72mxV122 *****                                                 16:44 Friday, October 2, 2020   1     
                                                                                                           
  Obs    SYSTEM    SRVCLASS    appl            date         hms          DURATM    dursecs                 
                                                                                                           
    1     QXG0     ASWPO301    ASW         20-09-28     0:00:00      0:15:00.00    899.995                 
    2     QXG0     ATAPO301    ATA         20-09-28     0:00:00      0:15:00.00    899.995     
...
Obs           CPUTM      CPUUNITS      SERVICE    cpupcen    cpupcent       
                                                                             
  1      0:00:00.02       1337.39        18218    0.00092     0.00025       
  2      0:00:01.63      87268.43      2064411    0.06020     0.01655       

..


Output:

Code:

Obs    SYSTEM     SRVCLASS    appl       date          hms          DURATM        dursecs         CPUTM          CPUUNITS      SERVICE    cpupcen  cpupcent                             
   1     QXG0     ASWPO301    ASW         20-09-28     0:00:00      0:15:00.00    899.995         0:00:00.02     1337.39       18218      0.00092  0.00025     
...


Thank you very much.

Based on your meaningless post, you don’t need to JOIN the lines, but instead - REMOVE DUPLICATES (on unknown keys?)

Please, use appropriate terminology... 36_2_51.gif
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Tue Oct 06, 2020 2:38 am
Reply with quote

Sample:
Code:
//LAZYBONE EXEC PGM=ICEMAN
//F1       DD *                                                       
  OBS    SYSTEM    SRVCLASS    APPL            DATE         HMS       
    1     QXG0     ASWPO301    ASW         20-09-28     0:00:00       
    2     QXG0     ATAPO301    ATA         20-09-28     0:00:00       
OBS           CPUTM      CPUUNITS      SERVICE    CPUPCEN    CPUPCENT 
  1      0:00:00.02       1337.39        18218    0.00092     0.00025 
  2      0:00:01.63      87268.43      2064411    0.06020     0.01655 
/*                                                                     
//F2       DD *                                                       
  OBS    SYSTEM    SRVCLASS    APPL            DATE         HMS       
    1     QXG0     ASWPO301    ASW         20-09-28     0:00:00       
    2     QXG0     ATAPO301    ATA         20-09-28     0:00:00       
OBS           CPUTM      CPUUNITS      SERVICE    CPUPCEN    CPUPCENT 
  1      0:00:00.02       1337.39        18218    0.00092     0.00025 
  2      0:00:01.63      87268.43      2064411    0.06020     0.01655 
/*                                                                     
//SYSOUT   DD SYSOUT=*                                                 
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  JOINKEYS F1=F1,FIELDS=(1,8,A)                                       
  JOINKEYS F2=F2,FIELDS=(1,8,A)                                       
  REFORMAT FIELDS=(F1:9,72,F2:9,72)                                   
  END                                                                 
/*                                                                     
//JNF1CNTL DD *                                                       
  OMIT COND=(1,10,SS,EQ,C'OBS',OR,46,1,CH,NE,C'-')                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(1:1,8,UFF,ZD))                     
  END                                                                 
/*                                                                     
//JNF2CNTL DD *                                                       
  OMIT COND=(1,10,SS,EQ,C'OBS',OR,46,1,CH,EQ,C'-')                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(1:1,8,UFF,ZD))                     
  END                                                                 
/*

Add the headings back and align the columns.
Back to top
View user's profile Send private message
kushkush

New User


Joined: 30 Jun 2005
Posts: 37
Location: Germany

PostPosted: Tue Oct 06, 2020 2:26 pm
Reply with quote

Thank you all. I changed the sas code which generates this out put and put a bigger linesize so that the observations are on one line.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top