Well, a minor "nit" in my last awk program. It works OK, but the line:

NR>1 && member==$1 {line=$0; member=$1;}

works as well by being:

NR>1 && member==$1 {line=$0;}

There was no need to set "member"  when it was already equal.

--
John McKown 
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * 
[email protected] * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or 
proprietary information. If you are not the intended recipient, please contact 
the sender by reply e-mail and destroy all copies of the original message. 
HealthMarkets(r) is the brand name for products underwritten and issued by the 
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance 
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The 
MEGA Life and Health Insurance Company.SM

 

> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[email protected]] On Behalf Of McKown, John
> Sent: Thursday, January 12, 2012 10:44 AM
> To: [email protected]
> Subject: Re: Audting PDS Datasets and comparing to find most 
> current member
> 
> Looks like you're using ISPF statistics, correct? I'll do my 
> "patent pending" "using z/OS UNIX in weird ways" method along 
> with my normal "pimping" of Dovetailed Technologies free Co:Z 
> product. Install Co:Z Dataset Pipes. 
> http://dovetail.com/downloads/coz/index.html. Run the 
> following UNIX script, which I called "audit.sh"
> 
> #!/bin/sh
> for i in "$@";do
> pdsdir $i |\
> tail +2 |\
> awk 'NF==6 {print $1 " " $4 "_" $5 " " $6}' |\
> sed "s/$/ $i/";
> done |\
> sort |\
> awk 'NR==1 {line=$0; member=$1;}
> NR>1 && member==$1 {line=$0; member=$1;}
> NR>1 && member!=$1 {print line;member=$1;line=$0;}
> END {print line;}
> '
> 
> audit.sh PDS1 PDS2 PDS3 PDS4 PDS5
> 
> replacing PDSn with the actual PDS dataset names.
> 
> 
> Each line of output is:
> 
> <member name><space><date&time><space><dsn>
> 
> pdsdir outputs one line of information with ISPF stats.
> the first awk filters out all lines except those with 6 fields, and 
> output the member name, created date and time separated with 
> a _, and the userid.
> The sed adds the dsn to the end of each line.
> the sort sorted by descending member name and date/time
> the awk compares and outputs the last line for each member 
> name, which is the one with the most recent date/time.
> 
> --
> John McKown 
> Systems Engineer IV
> IT
> 
> Administrative Services Group
> 
> HealthMarkets(r)
> 
> 9151 Boulevard 26 * N. Richland Hills * TX 76010
> (817) 255-3225 phone * 
> [email protected] * www.HealthMarkets.com
> 
> Confidentiality Notice: This e-mail message may contain 
> confidential or proprietary information. If you are not the 
> intended recipient, please contact the sender by reply e-mail 
> and destroy all copies of the original message. 
> HealthMarkets(r) is the brand name for products underwritten 
> and issued by the insurance subsidiaries of HealthMarkets, 
> Inc. -The Chesapeake Life Insurance Company(r), Mid-West 
> National Life Insurance Company of TennesseeSM and The MEGA 
> Life and Health Insurance Company.SM
> 
>  
> 
> > -----Original Message-----
> > From: IBM Mainframe Discussion List 
> > [mailto:[email protected]] On Behalf Of Lizette Koehler
> > Sent: Thursday, January 12, 2012 8:55 AM
> > To: [email protected]
> > Subject: Audting PDS Datasets and comparing to find most 
> > current member
> > 
> > I have the need to audit many PDS datasets.  I am trying to 
> > find the most
> > current version of the member. 
> > 
> > The information I need is
> > 
> > DSN          MEMBER         Lines of Member     Member Date Created 
> >    Member
> > Last Updated   USERID who Updated it (if available)
> > DSN1   ABC                500                   2011/01/02
> > 2012/01/01                 XYZ0001
> > 
> > 
> > Then I need to compare that information against similar datasets.
> > 
> > So if I have DSN1 DSN2 and DSN3
> > 
> > I will need to 
> > 1)  Get the above info from all 3 datasets
> > 2)  Compare results of DSN1 vs. DSN2, DSN2 vs DSN3 and DSN1 vs DSN3
> > 
> > Not so bad with 2 or 3 but I have around 50.
> > 
> > So before I go and invent a REXX to do this, I thought I 
> > would see if there
> > were any other recommendations about.  I know about LISTDSI 
> > but was not sure
> > if there was something else.
> > 
> > Thanks
> > 
> > Lizette Koehler
> > 
> > 
> ----------------------------------------------------------------------
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to [email protected] with the message: INFO IBM-MAIN
> > 
> > 
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
> 
> 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to