Are you building and submitting jobs with the API or from a shell script?
If the api, build each job, add it to a list, and then submit the list; all jobs will then have the same pgrp, which will be set to the job id of the first job in the list (the 'pgrp leader' is the job whose id matches the pgrp). The qb python module's qb.submit works like this:
import qb
jobA = { ... }
jobB = { ... }
submitted = qb.submit( [jobA, jobB] )
for j in submitted:
print '%(id)s: %(name)s' % j
If you're doing submission with the cmdline, you submit the first job, retrieve the submitted job's id, then pass that id to the qbsub --prgrp <id> .... command.