View previous topic :: View next topic
|
Author |
Message |
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
I am trying to extract smf records for a particular time period using the below program and write it to an external file,
Code: |
/* &smfdd - input smf file
&sas_strt - required interval start time.
&sas_end - required interval end time.
outdd - output filename */
data _null_;
infile &smfdd;
input @2 rectype pib1.
@3 smf_tm pib4.
@7 smf_jul pd4.
@11 sysid $char4. @;
if rectype = 2 or rectype = 3 then delete;
sttime = dhms(datejul(smf_jul+1900000),0,0,smf_tm/100);
if &sas_strt <= sttime <= &sas_end then do;
input;
file outdd;
put _infile_;
end;
run; |
but in the output file the records are distorted,
I mean that the input and output file records does not look the same.
Could you please let me know what could be causing this?
I could post the input and output records, but they are not viewable, they are just ....'s and other funny symbols.
Thanks in advance, |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Put infile &smfdd; before your second input statement. At least that is what i always do. How about the dcb values for the output (lrecl,blkszie,recfm)? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
It may be worth looking at PGM=IFASMFDP to see if you can select on date / time criteria. Can't recall if you can, but think that you might.
It's all in the SMF manual |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
SMF data has human-readable fields but in general is not in human-readable format. You should expect to see lots of periods and other odd symbols since much of the data is bit-oriented.
Quote: |
I mean that the input and output file records does not look the same. |
What is different about them -- posting they don't look the same is like posting something doesn't work? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
You should expect to see lots of periods and other odd symbols since much of the data is bit-oriented. |
Suggest you open 2 screens and view the first record of the output file (HEX ON) in one screen and the matching input record (again HEX ON) to see what is different.
If this does not help clarify, use copy/paste and the "Code" tag to post these 2 records here and someone should be able to help. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello, Thanks for your inputs. I was trying to compare SAS output with IFASMFDP job output..and got confused with IFASMFDP,
I was trying to extract a time interval of data using the below IFASMFDP card from 13th Feb 10:00 hrs to 14th Feb 11:00 hrs.
Code: |
DATE(2011044,2011045) ----> from 13th Feb 10:00 hrs to 14th Feb 11:00 hrs.
START(1000) END(1100)
OUTDD(SMFOUT,TYPE(000:255))
INDD(SMFIN,OPTIONS(DUMP)) |
but turns out the job returned output of 13th Feb 10:00hrs to 13th Feb 11:00 & 14th Feb 10:00 hrs to 14th Feb 11:00 hrs.
However SAS job returned the correct time interval SMF data,
So comparing IFASMFDP output to SAS output led to the confusion & this topic.
This topic can be considered as resolved.
@Peter,
Quote: |
Put infile &smfdd; before your second input statement |
If the infile statement is placed before the second input statement, then the first input statement will not know where to read the data from. So it would not work correctly, or am I missing something?
Thanks, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is resolved - thank you for letting us know
d |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Quote: |
If the infile statement is placed before the second input statement, then the first input statement will not know where to read the data from. So it would not work correctly, or am I missing something?
|
Yes you do. Suppose you have more than 1 input file ? |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
@Peter There is 1 input file and that is the input SMF file. Based on the time period specified to variables
&sas_strt - required interval start time.
&sas_end - required interval end time.
The records from input file are selected and written to output file outdd.
Regards, |
|
Back to top |
|
|
|