Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Formatting vertical records into horizontal layout

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Formatting vertical records into horizontal layout
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    Post subject:
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    Post subject: Reply to: Formatting vertical records into horizontal layout
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    Post subject: Reply to: Formatting vertical records into horizontal layout
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    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 Need to delete inactive records from ... Sanchayita Sinha DB2 5 Fri May 29, 2020 10:47 pm
No new posts Need SQL for two latest records havin... Q5P418 DB2 10 Sun May 10, 2020 8:24 am
No new posts Compare Two datasets and Override Mat... ArunkumarGanesan DFSORT/ICETOOL 7 Mon Apr 27, 2020 7:45 pm
No new posts Splice multiple records into single r... sarankriya DFSORT/ICETOOL 4 Wed Apr 15, 2020 10:55 pm
No new posts Include Group record based on detail ... guptae DFSORT/ICETOOL 11 Thu Mar 12, 2020 1:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us