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

Making horizontal rows


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

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Thu Jan 17, 2008 6:19 pm
Reply with quote

Hi,

I have following requirements.

I have got 1 file which is of 80 bytes record length. That file carries rows in the following way.

First 19 rows contain a single information about a policy. After that subsequent 19 rows contain another single information(ie from row no 20-38) about another policy. And another 19 about another like that it continues.

What i need is?

I want to make that 19 rows into single row. That means output file of record length 19 * 80 = 1520

Is there any shortest way to do that. I mean to read only particular no of rows and to format that using outrec.

Can you please help me out in this front?


Input file:(80 byte)
For eg:
LINE NO 1: POL123......................> till 80 byte
LINE NO 2: .................................> till 80 byte
.
.
.
LINE NO 19: .................>til 80 byte.

So first 19 lines are of same information. you can say single policy

LINE NO 20: POL124......................> till 80 byte
LINE NO 21: .................................> till 80 byte
.
.
.
LINE NO 38: .................>til 80 byte.

from 20-38 line no of same information, you can say second policy.


I want ouput for the above 38 rows ln following ways:

LINE NO1: POL123...........................> upto 1520 bytes(LINE1-19 concatenated)
LINE NO2: POL124............................> upto 1520 bytes(LINE20-38 concatenated).
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Thu Jan 17, 2008 10:58 pm
Reply with quote

Do the Policy records (first record of each group of 19) have an identifier of some kind in them? You show 'POLxxx' - do the first records really have 'POL' in positions 1-3, or do they something else that identifies them?

Is the RECFM FB or VB?
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Fri Jan 18, 2008 5:08 pm
Reply with quote

Frank Yaeger wrote:
Do the Policy records (first record of each group of 19) have an identifier of some kind in them? You show 'POLxxx' - do the first records really have 'POL' in positions 1-3, or do they something else that identifies them?

Is the RECFM FB or VB?


RECFM is FB of length 80.

No, it doesn't have any common identifier in them. POL is not correct keyword. Actually I have only D in 1st position. Nothing else.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Jan 18, 2008 10:11 pm
Reply with quote

noorkh,

The following DFSORT/ICETOOL jcl will give you the desired results. This job will combile every 19 records into a single record of 1520 bytes

Code:

//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN       DD DSN=your input file of 80 bytes,
//            DISP=SHR
//OUT      DD DSN=your output file of 1520 bytes,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//TOOLIN   DD *
  SPLICE FROM(IN) TO(OUT) WITHEACH -
      ON(1521,08,CH)               -
    WITH(0081,80)                  -
    WITH(0161,80)                  -
    WITH(0241,80)                  -
    WITH(0321,80)                  -
    WITH(0401,80)                  -
    WITH(0481,80)                  -
    WITH(0561,80)                  -
    WITH(0641,80)                  -
    WITH(0721,80)                  -
    WITH(0801,80)                  -
    WITH(0881,80)                  -
    WITH(0961,80)                  -
    WITH(1041,80)                  -
    WITH(1121,80)                  -
    WITH(1201,80)                  -
    WITH(1281,80)                  -
    WITH(1361,80)                  -
    WITH(1441,80)                  -
  KEEPNODUPS USING(CTL1)
/*
//CTL1CNTL     DD *
  INREC IFTHEN=(WHEN=INIT,
       OVERLAY=(1521:SEQNUM,8,ZD,START=19,INCR=1,
                1529:1521,8,ZD,MOD,+19,TO=ZD,LENGTH=2)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,01),
      BUILD=(0081:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,02),
      BUILD=(0161:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,03),
      BUILD=(0241:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,04),
      BUILD=(0321:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,05),
      BUILD=(0401:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,06),
      BUILD=(0481:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,07),
      BUILD=(0561:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,08),
      BUILD=(0641:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,09),
      BUILD=(0721:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,10),
      BUILD=(0801:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,11),
      BUILD=(0881:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,12),
      BUILD=(0961:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,13),
      BUILD=(1041:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,14),
      BUILD=(1121:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,15),
      BUILD=(1201:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,16),
      BUILD=(1281:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,17),
      BUILD=(1361:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8)),
     IFTHEN=(WHEN=(1529,2,ZD,EQ,18),
      BUILD=(1441:01,80,1521:1521,8,ZD,SUB,1529,2,ZD,M11,LENGTH=8))
   OUTFIL FNAMES=OUT,
     BUILD=(001,1520)
/*


Hope this helps...
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Sat Jan 19, 2008 1:42 pm
Reply with quote

Hi,

I will execute this and will let u know the output.
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Mon Jan 21, 2008 4:48 pm
Reply with quote

Skolusu,

Thanks for your suggestion. It worked very well.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Nov 06, 2010 3:44 am
Reply with quote

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct,2010), you can now use the new RESIZE operator of DFSORT's ICETOOL to do this much more easily like this:

Code:

//S1    EXEC  PGM=ICETOOL                 
//TOOLMSG DD SYSOUT=*                     
//DFSMSG  DD SYSOUT=*                     
//IN DD DSN=...  input file (FB/80)         
//OUT DD DSN=...  output file (FB/1520)     
//TOOLIN   DD   *                         
RESIZE FROM(IN) TO(OUT) TOLEN(1520)       
/*                                       


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
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 To get the count of rows for every 1 ... DB2 3
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts Compare latest 2 rows of a table usin... DB2 1
No new posts How to compare two rows of same table DB2 11
Search our Forums:

Back to Top