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

How to Convert Fields of a record (Rows) into Columns


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

New User


Joined: 05 Nov 2006
Posts: 4

PostPosted: Wed Nov 08, 2006 5:07 am
Reply with quote

Hi,

I have an Input file for the Amount fields(14 Bytes for Each field and the last byte is a signed bit) as follows


Code:

January         February         March

0000341269.40 0000000741.25-0000058721.31
0214000215.29 0005420990.32 0000003350.56
0000004023.13-0000004542.00 0000064288.39-


I want the Records of the input file to be wriiten as written as follows

Code:

0000341269.40       0214000215.29       0000004023.13-
0000000741.25-      0005420990.32       0000004542.00
0000058721.31       0000003350.56       0000064288.39-


Rows are to be displayed as columns

Let me know How to do it Using DFSort ?

Regards,
Krish
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: Wed Nov 08, 2006 5:28 am
Reply with quote

Assuming you just have the three input records as shown, this DFSORT/ICETOOL job will do what you asked for:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(61,1,CH) -
 WITHEACH WITH(21,14) WITH(41,14)  USING(CTL2)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,
   IFTHEN=(WHEN=INIT,OVERLAY=(62:SEQNUM,1,ZD)),
   IFTHEN=(WHEN=(62,1,ZD,EQ,+1),
    BUILD=(1:1,14,61:C'1',/,1:15,14,61:C'2',/,1:29,14,61:C'3')),
   IFTHEN=(WHEN=(62,1,ZD,EQ,+2),
    BUILD=(21:1,14,61:C'1',/,21:15,14,61:C'2',/,21:29,14,61:C'3')),
   IFTHEN=(WHEN=(62,1,ZD,EQ,+3),
    BUILD=(41:1,14,61:C'1',/,41:15,14,61:C'2',/,41:29,14,61:C'3'))
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,60)
/*
Back to top
View user's profile Send private message
Krishnamurthy

New User


Joined: 05 Nov 2006
Posts: 4

PostPosted: Thu Nov 09, 2006 6:03 am
Reply with quote

Thanks for your Quick response.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top