IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Formatting vertical records into horizontal layout


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Jasand

New User


Joined: 23 Jan 2009
Posts: 32
Location: Tamil nadu

PostPosted: Fri Mar 25, 2011 4:44 pm
Reply with quote

INPUT:

Code:
CC000AA********    GOOD MORNING ******   TIME
CC100AAJOBNAME  XXXX DESCRIPTION-------- 23:45
CC101BBJOBNAME  XXXX DESCRIPTION-------- 11:45
CC102CCJOBNAME  XXXX DESCRIPTION-------- 09:45
CC103DDJOBNAME  XXXX DESCRIPTION-------- 01:45
CC104EEJOBNAME  XXXX DESCRIPTION-------- 11:23
CC105FFJOBNAME  XXXX DESCRIPTION-------- 03:06
CC106GGJOBNAME  XXXX DESCRIPTION-------- 12:05
CC107HHJOBNAME  XXXX DESCRIPTION-------- 07:41
CC200AAJOBNAME  YYY  DESCRIPTION-------- 07:45
CC201BBJOBNAME  YYY  DESCRIPTION-------- 09:45
CC202CCJOBNAME  YYY  DESCRIPTION-------- 11:50
CC203DDJOBNAME  YYY  DESCRIPTION-------- 01:45
CC204EEJOBNAME  YYY  DESCRIPTION-------- 04:49
CC205FFJOBNAME  YYY  DESCRIPTION-------- 23:36
CC206GGJOBNAME  YYY  DESCRIPTION-------- 11:35
CC207HHJOBNAME  YYY  DESCRIPTION-------- 11:45


OUTPUT TEMPLATE:

Code:
*****************   REPORT START   ******
                                                     
      AA    BB    CC    DD    EE    FF    GG    HH   
     ----- ----- ----- ----- ----- ----- ----- ----- 
XXXX ..... ..... ..... ..... ..... ..... ..... ..... 
YYY  ..... ..... ..... ..... ..... ..... ..... ..... 
HHH  ..... ..... ..... ..... ..... ..... ..... ..... 
JJJ  ..... ..... ..... ..... ..... ..... ..... ..... 
WWW  ..... ..... ..... ..... ..... ..... ..... ..... 
IIII ..... ..... ..... ..... ..... ..... ..... ..... 
RRRR ..... ..... ..... ..... ..... ..... ..... ..... 
                                                     
*****************   REPORT END     ******


In the i/p file, the XXXX are one set of records and YYY are another set.

In CC100AAJOBNAME -
00 - indicate the beginning of each set, there are 7 sets like that (eg; XXXX, YYY, JJJ, WWW, IIII, RRRR)
AA - specify each category

need to get the 'TIME' of a particular set/ category into the output template.

Can somebody help with this ?
Back to top
View user's profile Send private message
Jasand

New User


Joined: 23 Jan 2009
Posts: 32
Location: Tamil nadu

PostPosted: Fri Mar 25, 2011 4:48 pm
Reply with quote

I tried a sort card like below, but couldnt get the exact format..

SORT FIELDS=COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(4,2,ZD,EQ,00),PUSH=(70:1,7)),
IFTHEN=(WHEN=(3,1,ZD,EQ,1,AND,6,2,CH,EQ,C'AA'),
BUILD=(6:42,5),HIT=NEXT),
IFTHEN=(WHEN=(3,1,ZD,EQ,1,AND,6,2,CH,EQ,C'BB'),
BUILD=(12:42,5),HIT=NEXT),
IFTHEN=(WHEN=(3,1,ZD,EQ,1,AND,6,2,CH,EQ,C'CC'),
BUILD=(18:42,5),HIT=NEXT),
IFTHEN=(WHEN=(3,1,ZD,EQ,1,AND,6,2,CH,EQ,C'DD'),
BUILD=(24:42,5),HIT=NEXT),
IFTHEN=(WHEN=(3,1,ZD,EQ,1,AND,6,2,CH,EQ,C'EE'),
BUILD=(30:42,5),HIT=NEXT),
IFTHEN=(WHEN=(3,1,ZD,EQ,1,AND,6,2,CH,EQ,C'FF'),
BUILD=(36:42,5),HIT=NEXT),
IFTHEN=(WHEN=(3,1,ZD,EQ,1,AND,6,2,CH,EQ,C'GG'),
BUILD=(42:42,5),HIT=NEXT),
IFTHEN=(WHEN=(3,1,ZD,EQ,1,AND,6,2,CH,EQ,C'HH'),
BUILD=(48:42,5),HIT=NEXT)

thought that BEGIN=(4,2,ZD,EQ,00) will help to identify the beginning of each set of record and BUILD will extract the TIME
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Mar 25, 2011 10:29 pm
Reply with quote

Jasand,

The following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN       DD *                                                 
CC000AA********    GOOD MORNING ******   TIME                   
CC100AAJOBNAME  XXXX DESCRIPTION-------- 23:45                 
CC101BBJOBNAME  XXXX DESCRIPTION-------- 11:45                 
CC102CCJOBNAME  XXXX DESCRIPTION-------- 09:45                 
CC103DDJOBNAME  XXXX DESCRIPTION-------- 01:45                 
CC104EEJOBNAME  XXXX DESCRIPTION-------- 11:23                 
CC105FFJOBNAME  XXXX DESCRIPTION-------- 03:06                 
CC106GGJOBNAME  XXXX DESCRIPTION-------- 12:05                 
CC107HHJOBNAME  XXXX DESCRIPTION-------- 07:41                 
CC200AAJOBNAME  YYY  DESCRIPTION-------- 07:45                 
CC201BBJOBNAME  YYY  DESCRIPTION-------- 09:45                 
CC202CCJOBNAME  YYY  DESCRIPTION-------- 11:50                 
CC203DDJOBNAME  YYY  DESCRIPTION-------- 01:45                 
CC204EEJOBNAME  YYY  DESCRIPTION-------- 04:49                 
CC205FFJOBNAME  YYY  DESCRIPTION-------- 23:36                 
CC206GGJOBNAME  YYY  DESCRIPTION-------- 11:35                 
CC207HHJOBNAME  YYY  DESCRIPTION-------- 11:45                 
//OUT      DD SYSOUT=*                                         
//TOOLIN   DD *                                                     
  SPLICE FROM(IN) TO(OUT) ON(1,4,CH) WITHANY KEEPNODUPS USING(CTL1) -
  WITH(06,5) WITH(12,5) WITH(18,5) WITH(24,5) WITH(30,5) WITH(36,5) -
  WITH(42,5) WITH(48,5)                                             
//CTL1CNTL DD *                                                     
  OPTION COPY,SKIPREC=1                                             
  INREC IFTHEN=(WHEN=INIT,BUILD=(17,4,35X,81:42,5,6,2)),             
  IFTHEN=(WHEN=(86,2,CH,EQ,C'AA'),OVERLAY=(06:81,5)),               
  IFTHEN=(WHEN=(86,2,CH,EQ,C'BB'),OVERLAY=(12:81,5)),               
  IFTHEN=(WHEN=(86,2,CH,EQ,C'CC'),OVERLAY=(18:81,5)),               
  IFTHEN=(WHEN=(86,2,CH,EQ,C'DD'),OVERLAY=(24:81,5)),               
  IFTHEN=(WHEN=(86,2,CH,EQ,C'EE'),OVERLAY=(30:81,5)),               
  IFTHEN=(WHEN=(86,2,CH,EQ,C'FF'),OVERLAY=(36:81,5)),               
  IFTHEN=(WHEN=(86,2,CH,EQ,C'GG'),OVERLAY=(42:81,5)),               
  IFTHEN=(WHEN=(86,2,CH,EQ,C'HH'),OVERLAY=(48:81,5))                 
                                                                     
  OUTFIL REMOVECC,BUILD=(1,80),                                     
  HEADER2=(18'*',21:'REPORT START',35:6'*',/,/,                     
           08:'AA    BB    CC    DD    EE    FF    GG    HH',/,     
           06:'----- ----- ----- ----- ----- ----- ----- -----'),   
  TRAILER1=(/,18'*',21:'REPORT END',35:6'*')                         
//*


The output from this job is
Code:

******************  REPORT START  ******                           
                                                                   
       AA    BB    CC    DD    EE    FF    GG    HH               
     ----- ----- ----- ----- ----- ----- ----- -----               
XXXX 23:45 11:45 09:45 01:45 11:23 03:06 12:05 07:41               
YYY  07:45 09:45 11:50 01:45 04:49 23:36 11:35 11:45               
                                                                   
******************  REPORT END    ******                           
Back to top
View user's profile Send private message
Jasand

New User


Joined: 23 Jan 2009
Posts: 32
Location: Tamil nadu

PostPosted: Sun Mar 27, 2011 10:25 am
Reply with quote

Many thanks Skolusu..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Selecting multiple constant records DB2 3
This topic is locked: you cannot edit posts or make replies. Writng matched records into output fi... DFSORT/ICETOOL 11
No new posts Merging more than two records DFSORT/ICETOOL 15
No new posts Matching and non matching records usi... DFSORT/ICETOOL 11
No new posts REMOVE DUPLICATE RECORDS BASED ON A S... DFSORT/ICETOOL 4
Search our Forums:

Back to Top