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 from a Report

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


Joined: 11 Mar 2009
Posts: 58
Topics: 25

PostPosted: Thu Mar 12, 2009 4:42 am    Post subject: Report from a Report Reply with quote

Hi

I've a report in the format below.
Quote:
Code:
1RUN DATE  03/09/09                                     xxxxxx - OHIO                                                    CB080S10/014
 RUN TIME  22:52:29                          DIRECTORY ASSISTANCE CONTROL REPORT                                       PAGE    1
                                                      FOR BILLING CYCLE 10
Detailed records
Detailed records
Detailed records
Detailed records
1RUN DATE  03/09/09                                     xxxxxx - OHIO                                                    CB080S10/014
 RUN TIME  22:52:29                          DIRECTORY ASSISTANCE CONTROL REPORT                                       PAGE    2
                                                      FOR BILLING CYCLE 10
Detailed records
Detailed records
Detailed records
Detailed records
1RUN DATE  03/09/09                               xxxxxx - NEW JERSEY, INC.                                              CB080S10/014
 RUN TIME  22:53:00                          DIRECTORY ASSISTANCE CONTROL REPORT                                       PAGE  105
                                                      FOR BILLING CYCLE 10
Detailed records
Detailed records
Detailed records
Detailed records
Detailed records
1RUN DATE  03/09/09                                 xxxxxx - PENNSYLVANIA                                                CB080S10/014
 RUN TIME  22:52:58                          DIRECTORY ASSISTANCE CONTROL REPORT                                       PAGE  103
                                                      FOR BILLING CYCLE 10 
Detailed records
Detailed records
Detailed records
Detailed records
Detailed records   



I need to generate a report from this containing only OHIO part as below and exclude others.

Quote:
Code:
1RUN DATE  03/09/09                                     xxxxxx - OHIO                                                    CB080S10/014
 RUN TIME  22:52:29                          DIRECTORY ASSISTANCE CONTROL REPORT                                       PAGE    1
                                                      FOR BILLING CYCLE 10
Detailed records
Detailed records
Detailed records
Detailed records
1RUN DATE  03/09/09                                     xxxxxx - OHIO                                                    CB080S10/014
 RUN TIME  22:52:29                          DIRECTORY ASSISTANCE CONTROL REPORT                                       PAGE    2
                                                      FOR BILLING CYCLE 10
Detailed records
Detailed records
Detailed records                                   


Please could you help me out the sort card to do this.

Thanks in advance
TVSSV
_________________
Thanks
TVSSV
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Thu Mar 12, 2009 10:10 am    Post subject: Reply with quote

Assuming that your records were wrapped in the above example, and that your input file is really FB/133, the following SORT step should produce your desired results:
Code:
//STEP1 EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*
//SORTOUT DD DSN=output.file,...
//SORTIN  DD DSN=input.file,...
//SYSIN   DD *                                           
   INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,8,CH,EQ,C'RUN DATE'),
         PUSH=(134:45,40))                                   
   SORT FIELDS=COPY                                       
   OUTFIL INCLUDE=(134,40,SS,EQ,C'OHIO'),OUTREC=(1,133)   
/*     


This will allow you to modify the INCLUDE statement for whichever state you wish to run the report for.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com


Last edited by amargulies on Thu Mar 12, 2009 10:23 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Mar 12, 2009 10:15 am    Post subject: Reply with quote

TVSSV,

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FBA/133)
//SORTOUT DD DSN=...  output file (FBA/133)
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'1RUN'),
    PUSH=(134:66,4))
  OUTFIL INCLUDE=(134,4,CH,EQ,C'OHIO'),
    BUILD=(1,133)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tvssv
Beginner


Joined: 11 Mar 2009
Posts: 58
Topics: 25

PostPosted: Fri Mar 13, 2009 2:21 am    Post subject: Reply with quote

Hi Frank Yaeger,

Thankyou.

I've tried this, but I'm getting the below error.
Code:

COMPLETION CODE - SYSTEM=000 USER=0016 REASON=000000 

The SYSOUT message is

Code:
SYNCSORT FOR Z/OS  1.3.1.0R   
 
SYSIN :                                                                       
   OPTION COPY                                                          0000200
   INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'1RUN'),                  0000210
                      *                                                       
      PUSH=(134:66,4))                                                  0000220
   OUTFIL INCLUDE=(134,4,CH,EQ,C'OHIO'),                                0000230
   BUILD=(1,133)                                                        0000240
WER268A  INREC STATEMENT   : SYNTAX ERROR                                     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIV
[/code]

I've coded jcl like this

Code:
//STEP0100 EXEC PGM=SORT                                               
//SYSOUT    DD SYSOUT=*                                                 
//SORTIN    DD DSN=GRIP.CBORTCRD.REPORT,DISP=SHR       
//SORTOUT   DD DSN=GRIP.CBORTCRD.REPORT.EXT,                   
//             DISP=(OLD,CATLG,DELETE),UNIT=SYSDA,                     
//             SPACE=(CYL,(5,5),RLSE),                                 
//             DCB=(RECFM=VB,BLKSIZE=27930,LRECL=133)                   
//SYSIN     DD *                                                       
   OPTION COPY                                                         
   INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'1RUN'),                 
      PUSH=(134:66,4))                                                 
   OUTFIL INCLUDE=(134,4,CH,EQ,C'OHIO'),                               
   BUILD=(1,133)                                                       
/*                                                                     


Please correct me where I went wrong.

Thanks & Regards
TVSSV
_________________
Thanks
TVSSV
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Fri Mar 13, 2009 9:33 am    Post subject: Reply with quote

TVSSV,

Support for WHEN=GROUP was included in SyncSort for z/OS 1.3.2.0. You are getting the syntax error because you are running an earlier release of the product which does not support this feature.

(FYI, the maintenance upgrade is free).

Regards,
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
tvssv
Beginner


Joined: 11 Mar 2009
Posts: 58
Topics: 25

PostPosted: Sat Mar 14, 2009 12:48 pm    Post subject: Reply with quote

Hi,

Thank you.

Is there any other way to get the desired result with the existing version in my shop syncsort for z/os 1.3.2

Thanks & Regards
TVSSV
_________________
Thanks
TVSSV
Back to top
View user's profile Send private message
bprasanna
Beginner


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

PostPosted: Mon Apr 13, 2009 5:01 am    Post subject: Reply with quote

TVSSV,
Please check the below code.(Successfully tested with SYNCSORT FOR Z/OS 1.2.1.1NI).

Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN       DD  DSN=YOUR INOUT FILE,DISP=SHR   
//T0 DD DSN=&&T0,UNIT=SYSDK,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//T1 DD DSN=&&T1,UNIT=SYSDK,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//T2 DD DSN=&&T1,UNIT=SYSDK,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//OUT      DD DSN=XXX.XXXX.XXXX.OUT,                     
//            DISP=(NEW,CATLG,DELETE),                       
//            UNIT=SYSDK,                                     
//            SPACE=(CYL,(100,100),RLSE),                     
//            DCB=(LRECL=80,RECFM=FB)                         
//TOOLIN   DD *                                               
  COPY FROM(IN) TO(T0) USING(CTL0)                           
  COPY FROM(T0) TO(T1) USING(CTL1)                           
  SPLICE FROM(T1) TO(T2) ON(144,8,ZD) -                       
  WITHALL WITH(1,133) KEEPBASE                               
  SORT FROM(T2) TO(OUT) USING(CTL2)                           
//CTL0CNTL DD *                                               
  INREC IFTHEN=(WHEN=(2,8,CH,EQ,C'RUN DATE'),                 
  BUILD=(1,138,66,4))                                         
//CTL1CNTL DD *                                               
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(144:SEQNUM,8,ZD)),         
  IFTHEN=(WHEN=(139,4,CH,NE,C'    '),                         
  OVERLAY=(134:139,4,144:SEQNUM,8,ZD)),                       
  IFTHEN=(WHEN=NONE,                                         
  OVERLAY=(152:SEQNUM,8,ZD,                                   
  144:144,8,ZD,SUB,152,8,ZD,M11,LENGTH=8))                   
//CTL2CNTL DD *                                               
  SORT FIELDS=COPY                                           
  INCLUDE COND=(134,4,CH,EQ,C'OHIO')                         
  OUTREC FIELDS=(1,80)                                       

_________________
----------------
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