View previous topic :: View next topic
Author
Message
kushkush New User Joined: 30 Jun 2005Posts: 37 Location: Germany
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
Nic Clouston Global Moderator Joined: 10 May 2007Posts: 2455 Location: Hampshire, UK
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
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1138 Location: Bamberg, Germany
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
sergeyken Senior Member Joined: 29 Apr 2008Posts: 1884 Location: USA
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...
Back to top
Joerg.Findeisen Senior Member Joined: 15 Aug 2015Posts: 1138 Location: Bamberg, Germany
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
kushkush New User Joined: 30 Jun 2005Posts: 37 Location: Germany
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
Please enable JavaScript!