Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Convert Rows to Columns for same Key in Syncsort(V1.2)
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Fri Apr 24, 2009 9:43 pm    Post subject:
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: 500
Location: USA

PostPosted: Fri Apr 24, 2009 10:04 pm    Post subject:
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: 500
Location: USA

PostPosted: Fri Apr 24, 2009 11:07 pm    Post subject: Reply to: Convert Rows to Columns for same Key in Syncsort(V
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Convert current to hex value gopurs DFSORT/ICETOOL 4 Wed Feb 15, 2017 5:40 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us