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

Convert Rows to Columns for same Key in Syncsort(V1.2)


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Raghuraman_New

New User


Joined: 03 Oct 2008
Posts: 43
Location: Chennai,India.

PostPosted: Fri Apr 24, 2009 9:17 pm
Reply with quote

Hi,

My Input data,

Key1 Data1
Key1 Data2
Key2 Data3
Key2 Data4
Key3 Data5
Key3 Data6
Key4 Data7
Key4 Data8

Required Output,

Key1 Data1 Data2
Key2 Data3 Data4
Key3 Data5 Data6
Key4 Data7 Data8
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 24, 2009 9:26 pm
Reply with quote

apparently you want to join keys based on cc 1 thru 4.

I invite you to search the JCL forum for JOINKEYS.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Apr 24, 2009 9:43 pm
Reply with quote

Stuck at Syncsort(V1.2), I don't think it will be easy if at all possible.....
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Apr 24, 2009 10:04 pm
Reply with quote

Raghuram,

What is the maximum number of records that can contain the same key. In other words, how many columns of data for each key would be contained in the output? Is it always 2?
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Apr 24, 2009 11:07 pm
Reply with quote

Based on the sample data you provided, here is a SyncSort for z/OS 1.2 application that should produce the desired output:
Code:
//SORT1 EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*
//SORTIN  DD *       
KEY1 DATA1           
KEY1 DATA2           
KEY2 DATA3           
KEY2 DATA4           
KEY3 DATA5           
KEY3 DATA6           
KEY4 DATA7           
KEY4 DATA8           
//SORTOUT 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)       
/*       
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Increase the number of columns in the... IBM Tools 3
Search our Forums:

Back to Top