Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Vetical to Horizontal Transformation

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

New User


Joined: 28 Mar 2014
Posts: 1
Location: USA

PostPosted: Thu Jun 12, 2014 8:31 pm    Post subject: Vetical to Horizontal Transformation
Reply with quote

Hi All,

I have a input file and it needs to transformed as explained below using
SORT( I execute PGM=SORT)

Input file:
-----------
Code:
       col1         col2     space
DBNAME1 DB2A  10
DBNAME1 DB2B  12
DBNAME1 DB2C  14
DBNAME1 DB2D  20
DBNAME2 DB2A  10
DBNAME2 DB2C  15
DBNAME2 DB2D  20


Output :
---------
Code:
       col1    col2 col3  col4  col5
DBNAME1  10     12   14     20
DBNAME2  10     15   20


I dont need the DB2* column as the 2nd column in outfile will be populated from DB2A ,3rd column from DB2B, 4th from DB2C and 4th from DB2D.
If space is not found for a system in the 2nd column of input file it has to be filled with spaces.

The input file will be sorted on Column 1 and Column 2

Code'd and de-mangled
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1805
Location: NY,USA

PostPosted: Tue Jun 17, 2014 1:58 am    Post subject:
Reply with quote

If you have a syncsort then you can refer to the below example and try to make the necessary changes as per your requirements otherwise please ignore,

Code:
//SORT1 EXEC PGM=SORT,PARM='EQUALS'                         
//STEPLIB DD DSN=WCS.TS.SS12DN,UNIT=SYSDA,DISP=SHR 
//SORTIN  DD *                                       
KEY1 DATA1                                         
KEY1 DATA2                                         
KEY2 DATA3                                         
KEY2 DATA4                                         
KEY3 DATA5                                         
KEY3 DATA6                                         
KEY4 DATA7                                         
KEY4 DATA8                                         
//SORTOUT DD SYSOUT=*                           
//SYSOUT  DD SYSOUT=*                           
//SYSIN   DD *                                   
  INREC IFTHEN=(WHEN=INIT,                     
       OVERLAY=(81:SEQNUM,1,ZD,RESTART=(1,4))),
        IFTHEN=(WHEN=(81,1,ZD,EQ,1),           
         BUILD=(1:1,11,12:6Z)),                 
        IFTHEN=(WHEN=(81,1,ZD,EQ,2),           
         BUILD=(1:1,5,6:6Z,12:6,5,1Z))         
   SORT FIELDS=(1,4,CH,A)                       
   SUM FIELDS=(6,4,BI,10,4,BI,14,4,BI)


Output :

Code:
KEY1 DATA1 DATA2
KEY2 DATA3 DATA4
KEY3 DATA5 DATA6
KEY4 DATA7 DATA8   
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 Merge horizontal kranthikumarb DFSORT/ICETOOL 1 Fri Aug 29, 2014 8:47 am
No new posts Transpose values from Vertical to hor... gayathrinag DFSORT/ICETOOL 14 Mon Dec 03, 2012 12:11 am
No new posts XML numeric parse transformation problem dejunzhu COBOL Programming 10 Fri Mar 02, 2012 2:12 pm
No new posts Vertical records into horizontal layo... carlmgu DFSORT/ICETOOL 11 Fri Aug 19, 2011 9:53 pm
No new posts Formatting vertical records into hori... Jasand DFSORT/ICETOOL 3 Fri Mar 25, 2011 4:44 pm

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