Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

need help to seperate report file based upon header data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Wed Sep 23, 2009 11:58 pm    Post subject: need help to seperate report file based upon header data
Reply with quote

Hi,
I need one help to seperate below kind of data:

XXXXXXXXXXHEADERXXXXAAXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3
XXXXXXXXXXHEADERXXXXAAXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3
DETAIL LINE4
XXXXXXXXXXHEADERXXXXBBXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3
XXXXXXXXXXHEADERXXXXCCXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3
DETAIL LINE4
XXXXXXXXXXHEADERXXXXCCXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3


Now I want data seperated in below fashion:

One AA.FILE will contain:
XXXXXXXXXXHEADERXXXXAAXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3
XXXXXXXXXXHEADERXXXXAAXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3
DETAIL LINE4

One BB.FILE will contain:
XXXXXXXXXXHEADERXXXXBBXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3

One CC.FILE will contain
XXXXXXXXXXHEADERXXXXCCXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3
DETAIL LINE4
XXXXXXXXXXHEADERXXXXCCXXXX
DETAIL LINE1
DETAIL LINE2
DETAIL LINE3


Can someone please help how the ICETOOL job will like if I consider it as
a 133 bytes file and 'HEADER' is (45,6) and the code(refers - 'AA','BB') is (55,2).
But I actually dont have the code or anthing in the detail lines to distinguish.
Somehow I have to manage it with the header only.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Sep 24, 2009 1:07 am    Post subject:
Reply with quote

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 (FB/133)
//OUTAA DD DSN=AA.FILE,...
//OUTBB DD DSN=BB.FILE,...
//OUTCC DD DSN=CC.FILE,...
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(45,6,CH,EQ,C'HEADER'),
    PUSH=(134:55,2))
  OUTFIL FNAMES=OUTAA,INCLUDE=(134,2,CH,EQ,C'AA'),BUILD=(1,133)
  OUTFIL FNAMES=OUTBB,INCLUDE=(134,2,CH,EQ,C'BB'),BUILD=(1,133)
  OUTFIL FNAMES=OUTCC,INCLUDE=(134,2,CH,EQ,C'CC'),BUILD=(1,133)
/*
Back to top
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Thu Sep 24, 2009 2:40 pm    Post subject:
Reply with quote

I am sorry..Actually file is of 62 bytes FB and the 'HEADER' is within (37,6) and the code is in (9,2) in above case.
I ran the below job:
==========

Code:
//STEP1  EXEC PGM=SORT                       
//SORTIN    DD DSN=XX.TEST.XXXXXXXX,DISP=SHR
//OUTMS     DD DSN=MS.XXXXXX.SORTOUT,
//          DISP=(,CATLG),                   
//          UNIT=SYSDA,                         
//          SPACE=(CYL,(30,20),RLSE)
//OUTHP     DD DSN=HP.XXXXXX.SORTOUT,
//          DISP=(,CATLG),                   
//          UNIT=SYSDA,                         
//          SPACE=(CYL,(30,20),RLSE)
//OUTSW     DD DSN=SW.XXXXXX.SORTOUT,
//          DISP=(,CATLG),                   
//          UNIT=SYSDA,                         
//          SPACE=(CYL,(30,20),RLSE)
//OUTSZ     DD DSN=SZ.XXXXXX.SORTOUT,
//          DISP=(,CATLG),                   
//          UNIT=SYSDA,                         
//          SPACE=(CYL,(30,20),RLSE)
//SYSIN     DD *                                                       
   OPTION COPY                                                         
   INREC IFTHEN=(WHEN=GROUP,BEGIN=(37,6,CH,EQ,C'HEADER'),PUSH=(63:9,2))
   OUTFIL FNAMES=OUTMS,INCLUDE=(63,2,CH,EQ,C'MS'),BUILD=(1,62)         
   OUTFIL FNAMES=OUTHP,INCLUDE=(63,2,CH,EQ,C'HP'),BUILD=(1,62)         
   OUTFIL FNAMES=OUTSW,INCLUDE=(63,2,CH,EQ,C'SW'),BUILD=(1,62)         
   OUTFIL FNAMES=OUTSZ,INCLUDE=(63,2,CH,EQ,C'SZ'),BUILD=(1,62)         
 /*                                                                                                           
=============Getting the below msg in sysout:

ICE143I 0 BLOCKSET     COPY  TECHNIQUE SELECTED                                             
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE       
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 03:59
            OPTION COPY                                                                     
            INREC IFTHEN=(WHEN=GROUP,BEGIN=(37,6,CH,EQ,C'HEADER'),PUSH=(63:9,2))             
              $                                                                             
ICE007A 0 SYNTAX ERROR                                                                       
            OUTFIL FNAMES=OUTMS,INCLUDE=(63,2,CH,EQ,C'MS'),BUILD=(1,62)                     
            OUTFIL FNAMES=OUTHP,INCLUDE=(63,2,CH,EQ,C'HP'),BUILD=(1,62)                     
            OUTFIL FNAMES=OUTSW,INCLUDE=(63,2,CH,EQ,C'SW'),BUILD=(1,62)                     
            OUTFIL FNAMES=OUTSZ,INCLUDE=(63,2,CH,EQ,C'SZ'),BUILD=(1,62)                     
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E7-K24705                                 
ICE052I 3 END OF DFSORT


Could you please help me once again as didn't understand why the syntax error is throwing for when=group.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Sep 24, 2009 3:56 pm    Post subject:
Reply with quote

Hi,

my guess would be because you don't have the latest PTF which supports GROUP function.

Gerry
Back to top
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Thu Sep 24, 2009 4:01 pm    Post subject:
Reply with quote

Can I do it with any other option??or place the syntax in any other way..
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Sep 24, 2009 8:56 pm    Post subject:
Reply with quote

You need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) to use WHEN=GROUP. You don't have it installed. Ask your System Programmer to install it (it's free).
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Sep 24, 2009 9:25 pm    Post subject:
Reply with quote

sid_aec,

Try this

Code:

//STEP0100 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*
//IN       DD DSN=XX.TEST.XXXXXXXX,DISP=SHR
//OUTMS    DD DSN=MS.XXXXXX.SORTOUT,
//            DISP=(,CATLG),                   
//            UNIT=SYSDA,                         
//            SPACE=(CYL,(30,20),RLSE)
//OUTHP    DD DSN=HP.XXXXXX.SORTOUT,
//            DISP=(,CATLG),                   
//            UNIT=SYSDA,                         
//            SPACE=(CYL,(30,20),RLSE)
//OUTSW    DD DSN=SW.XXXXXX.SORTOUT,
//            DISP=(,CATLG),                   
//            UNIT=SYSDA,                         
//            SPACE=(CYL,(30,20),RLSE)
//OUTSZ    DD DSN=SZ.XXXXXX.SORTOUT,
//            DISP=(,CATLG),                   
//            UNIT=SYSDA,                         
//            SPACE=(CYL,(30,20),RLSE)
//OUT      DD DUMMY                                                 
//TOOLIN   DD *                                                     
  SPLICE FROM(IN) TO(OUT) ON(63,8,CH) WITH(1,70) -                 
  KEEPBASE WITHALL USING(CTL1)                                     
//CTL1CNTL DD *                                                     
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(63:SEQNUM,8,ZD)),               
  IFTHEN=(WHEN=(37,6,CH,EQ,C'HEADER'),OVERLAY=(63:SEQNUM,8,ZD,9,2)),
  IFTHEN=(WHEN=NONE,OVERLAY=(71:SEQNUM,8,ZD,                       
          63:63,8,ZD,SUB,71,8,ZD,M11,LENGTH=8))                     
                                                                   
  OUTFIL FNAMES=OUTMS,BUILD=(1,62),INCLUDE=(71,2,CH,EQ,C'MS')       
  OUTFIL FNAMES=OUTHP,BUILD=(1,62),INCLUDE=(71,2,CH,EQ,C'HP')       
  OUTFIL FNAMES=OUTSW,BUILD=(1,62),INCLUDE=(71,2,CH,EQ,C'SW')       
  OUTFIL FNAMES=OUTSZ,BUILD=(1,62),INCLUDE=(71,2,CH,EQ,C'SZ')       
/*
Back to top
View user's profile Send private message
sid_aec

New User


Joined: 01 Jul 2008
Posts: 60
Location: Kolkata

PostPosted: Thu Sep 24, 2009 10:32 pm    Post subject: Reply to: need help to seperate report file based upon heade
Reply with quote

Thanks a lot for your reply.However not tried yet as currently I am not accessing mainframe..but I got the trick with splice command...Thanks again..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us