MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

report generation thru SYNCSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Wed Jun 07, 2006 1:47 pm    Post subject: report generation thru SYNCSORT Reply with quote

Hi,
Is there any possibility to generate a report thru SORT like below.I know that this is possible thru Ezt.

My i/p file of length 80 and FB type.The i/p looks like
Code:

aaaaaaa      bbbbbbbb
aaaaaaa      cccccccc
aaaaaaa      dddddddd
bbbbbbb      cccccccc
ccccccc      dddddddd
ccccccc      eeeeeeee

I want to get the o/p file like below.
Code:

aaaaaaa     bbbbbbbb
            cccccccc
            dddddddd
bbbbbbb     cccccccc
ccccccc     dddddddd
            eeeeeeee

Thank you
Bprasanna
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Wed Jun 07, 2006 2:51 pm    Post subject: Reply with quote

Bprasanna,

If you have SYNCSORT FOR Z/OS 1.2.1.1R then the following JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                   
AAAAAAA      BBBBBBBB                           
AAAAAAA      CCCCCCCC                           
AAAAAAA      DDDDDDDD                           
BBBBBBB      CCCCCCCC                           
CCCCCCC      DDDDDDDD                           
CCCCCCC      EEEEEEEE                           
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                   
 SORT FIELDS=COPY                               
 INREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,7))   
 OUTFIL IFOUTLEN=80,                           
        IFTHEN=(WHEN=(81,8,ZD,GT,1),           
          OVERLAY=(1:7X))                       
/*                                             


If you get an error with the above job, you can try this job.
Code:

//STEP0200 EXEC PGM=SYNCTOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD *                                                   
AAAAAAA      BBBBBBBB                                             
AAAAAAA      CCCCCCCC                                             
AAAAAAA      DDDDDDDD                                             
BBBBBBB      CCCCCCCC                                             
CCCCCCC      DDDDDDDD                                             
CCCCCCC      EEEEEEEE                                             
//UNQ      DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)         
//DUP      DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)         
//CON      DD DSN=&T1,VOL=REF=*.UNQ,DISP=OLD                       
//         DD DSN=&T2,VOL=REF=*.DUP,DISP=OLD                       
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                   
  SELECT FROM(IN) TO(UNQ) ON(1,7,CH) FIRST DISCARD(DUP) USING(CTL1)
  SORT FROM(CON) USING(CTL2)                                       
//CTL1CNTL DD *                                                   
  OUTREC FIELDS=(1,80,SEQNUM,8,ZD)                                 
  OUTFIL FNAMES=UNQ,                                               
  OUTREC=(1,88)                                                   
  OUTFIL FNAMES=DUP,                                               
  OUTREC=(7X,8,81)                                                 
//CTL2CNTL DD *                                                   
  SORT FIELDS=(81,8,CH,A)                                         
  OUTFIL FNAMES=OUT,                                               
  OUTREC=(1,80)                                                   
/*


If that gives you an error then try this job

Code:

//STEP0300 EXEC PGM=SYNCTOOL                             
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN       DD *                                           
AAAAAAA      BBBBBBBB                                     
AAAAAAA      CCCCCCCC                                     
AAAAAAA      DDDDDDDD                                     
BBBBBBB      CCCCCCCC                                     
CCCCCCC      DDDDDDDD                                     
CCCCCCC      EEEEEEEE                                     
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//CTL1XSUM DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//CON      DD DSN=&T1,DISP=OLD,VOL=REF=*.T1               
//         DD DSN=&T2,DISP=OLD,VOL=REF=*.CTL1XSUM         
//OUT      DD SYSOUT=*                                   
//TOOLIN   DD *                                           
  SORT FROM(IN) USING(CTL1)                               
  SORT FROM(CON) USING(CTL2)                             
//CTL1CNTL DD *                                           
  INREC FIELDS=(1,80,7X,8,73,SEQNUM,8,ZD)                 
  SORT FIELDS=(01,07,CH,A)                               
  SUM FIELDS=NONE,XSUM                                   
  OUTFIL FNAMES=T1,                                       
  OUTREC=(1,80,1,7,88,81)                                 
//CTL2CNTL DD *                                           
  INREC FIELDS=(81,88)                                   
  SORT FIELDS=(81,8,CH,A)                                 
  OUTFIL FNAMES=OUT,OUTREC=(1,80)                         
/*                                                       


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Wed Jun 07, 2006 8:10 pm    Post subject: Reply with quote

Hi Kolusu,
Thanks a lot for the reply. My shop is having the release of Z/OS 1.2.0.0R.So the second one worked file.

Thank you
Bprasanna
_________________
----------------
Thanks&Regards
Bprasanna
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group