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
 
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: 6968
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 Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am

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