AIX os level 6.1 for list of users and groups

I have a AIX server o/s 5.3.0.0 and a few at o/s 6.1.0.0
The issue I am haveing is running this on the server with o/s of 5.3 works good but not on the o/s of 6.1 any help out here??

#!/usr/bin/ksh
user -a pgrp groups ALL |awk '{print $1}' > a1
lsuser -a pgrp groups ALL |awk '{print $2}'|cut -f2 -d= > a2
lsuser -a pgrp groups ALL |awk '{print $3}'|cut -f2 -d= > a3
echo "name pgrp group" > list_of_user
echo "-----------------------" >> list_of_user
paste a1 a2 a3 >> list_of_user
rm a1 a2 a3

Are you saying those commands do not work? Which of the 5?

The code works fine on the older o/s the 5.3 but not on the 6.1

Do the three a? files come out the same?

first you need compare if output format are same in AIX 5 or 6 by below command:

lsuser -a pgrp groups ALL

my AIX 5 sample output:

root pgrp=system groups=system,bin,sys,security,cron,audit,lp

Second, your command can be rewritten by one command, no temp file need be generated.

lsuser -a pgrp groups ALL |sed 's/pgrp=//;s/groups=//'