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

Columns to Rows


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

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Aug 04, 2011 4:04 pm
Reply with quote

Hi,

I have a requirement where I have a input file having 10 records each of 5 bytes. I want to write these 10 records to one row in the output file.

Example
Code:

INPUT:
AAAAA
12345
BBBBB
64321
CCCCC
FFFFF
QQQQQ
ZZZZZ

OUTPUT
AAAAA 12345 BBBBB 64321 CCCCC FFFFF QQQQQ ZZZZZ


Please let me know how can i achieve this using sysncsort?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Aug 04, 2011 4:18 pm
Reply with quote

Is input going to have only 10 records always?

What is the version of SYNCSORT you are using?

LRECL and RECFM of input and output files Please...
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Aug 04, 2011 4:38 pm
Reply with quote

Yes, the number of records will be constant.

SYNCSORT version - SYNCSORT FOR Z/OS 1.3.2.0RI

LRECL of INPUT file - 5
RECFM of INPUT file - FB

Output - LRECL - 80
RECFM FB
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Aug 04, 2011 11:22 pm
Reply with quote

gylbharat,
If you haven't already got the solution then try below(tested on DFSort)...
Code:
//STEP0001 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD  SYSOUT=*                                       
//DFSMSG   DD  SYSOUT=*                                       
//IN       DD  YOUR INPUT FB/5                                 
//OUT      DD  OUTPUT FB/80                                   
//TOOLIN   DD  *                                               
 SPLICE FROM(IN) TO(OUT) ON(89,1,CH) WITHEACH WITH(07,5) -     
 WITH(14,5) WITH(21,5) WITH(28,5) WITH(35,5) WITH(42,5) -     
 WITH(49,5) WITH(56,5) WITH(63,5) USING(CTL1)                 
/*                                                             
//CTL1CNTL DD *                                               
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,C'1')),     
        IFTHEN=(WHEN=(81,8,ZD,EQ,02),OVERLAY=(07:1,5)),       
        IFTHEN=(WHEN=(81,8,ZD,EQ,03),OVERLAY=(14:1,5)),       
        IFTHEN=(WHEN=(81,8,ZD,EQ,04),OVERLAY=(21:1,5)),       
        IFTHEN=(WHEN=(81,8,ZD,EQ,05),OVERLAY=(28:1,5)),       
        IFTHEN=(WHEN=(81,8,ZD,EQ,06),OVERLAY=(35:1,5)),       
        IFTHEN=(WHEN=(81,8,ZD,EQ,07),OVERLAY=(42:1,5)),       
        IFTHEN=(WHEN=(81,8,ZD,EQ,08),OVERLAY=(49:1,5)),       
        IFTHEN=(WHEN=(81,8,ZD,EQ,09),OVERLAY=(56:1,5)),       
        IFTHEN=(WHEN=(81,8,ZD,EQ,10),OVERLAY=(63:1,5))         
  OUTFIL FNAMES=OUT,BUILD=(1,80)                               
                                                               
/*                                                             
//SYSOUT   DD  SYSOUT=*                                       
//*                                                           

Thanks,
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Aug 05, 2011 10:58 am
Reply with quote

Thanks Sqlcode1.... I wanted to know how the same can be achieved without using ICETOOL and DFSORT ....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Aug 05, 2011 1:30 pm
Reply with quote

Hello,

Suggest you try the solution given and post back if there are problems.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Fri Aug 05, 2011 7:38 pm
Reply with quote

gylbharat,
Well I only have DFSort installed at my shop but the posted solution "should" also work for Syncsort.

Quote:
I wanted to know how the same can be achieved without using ICETOOL and DFSORT ...
I am not sure if I understood this correctly but by this, if you meant using other functions, then DFSort has RESIZE function which one can use but I am not sure if Syncsort has similar function available. Only other way I can think of would using IFTHEN GROUP 9 times, and selecting last record.

Thanks,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Aug 06, 2011 9:40 am
Reply with quote

Hello,

Have you tried running this with Syncsort?

What happened?
Back to top
View user's profile Send private message
Vasanthr

New User


Joined: 24 Jan 2011
Posts: 21
Location: India

PostPosted: Wed Aug 10, 2011 2:03 pm
Reply with quote

I tried the same JCl with syncsort . It worked perfectly
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 Remote Unload of CLOB Columns DB2 6
No new posts Increase the number of columns in the... IBM Tools 3
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
Search our Forums:

Back to Top