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

Syncsort to Convert records to Column


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sreejeshcs

New User


Joined: 28 May 2007
Posts: 31
Location: Pune

PostPosted: Sun Nov 03, 2013 2:50 am
Reply with quote

I need a help to convert to the below row data to columns

I/P:
4770900777
4770979464
4770977464
4770220674
4779077492
4779249942
4779707770
4779406079
4779442744
4772704490
4772727777
4772727702

O/P
4770900777, 4770979464, 4770977464, 4770220674, 4779077492
4779249942, 4779707770, 4779406079, 4779442744, 4772704490
4772727777, 4772727702

Grouping of 5 records to Columns.

Can some one help?
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Nov 04, 2013 10:29 am
Reply with quote

Hi,

try this
Code:
  SORT FIELDS=COPY                                                 
  INREC IFTHEN=(WHEN=INIT,                                         
                OVERLAY=(11:SEQNUM,3,ZD)),                         
        IFTHEN=(WHEN=INIT,                                         
                OVERLAY=(14:11,3,ZD,MOD,+5,EDIT=(T))),             
        IFTHEN=(WHEN=GROUP,END=(14,1,ZD,EQ,0),PUSH=(15:ID=1)),     
        IFTHEN=(WHEN=GROUP,BEGIN=(14,1,ZD,EQ,01),PUSH=(016:1,10)), 
        IFTHEN=(WHEN=GROUP,BEGIN=(14,1,ZD,EQ,02),PUSH=(026:1,10)), 
        IFTHEN=(WHEN=GROUP,BEGIN=(14,1,ZD,EQ,03),PUSH=(036:1,10)), 
        IFTHEN=(WHEN=GROUP,BEGIN=(14,1,ZD,EQ,04),PUSH=(046:1,10)), 
        IFTHEN=(WHEN=GROUP,BEGIN=(14,1,ZD,EQ,00),PUSH=(056:1,10))   
 OUTREC IFTHEN=(WHEN=(14,1,ZD,EQ,01),                               
               BUILD=(1,25)),                                       
        IFTHEN=(WHEN=(14,1,ZD,EQ,02),                               
               BUILD=(1,25,C',',26,10)),                           
        IFTHEN=(WHEN=(14,1,ZD,EQ,03),                               
               BUILD=(1,25,C',',26,10,C',',36,10)),                 
        IFTHEN=(WHEN=(14,1,ZD,EQ,04),                               
               BUILD=(1,25,C',',26,10,C',',36,10,C',',46,10)), 
        IFTHEN=(WHEN=(14,1,ZD,EQ,00),                           
   BUILD=(1,25,C',',26,10,C',',36,10,C',',46,10,C',',56,10))   
   OUTFIL REMOVECC,NODETAIL,BUILD=(16,54),                     
   SECTIONS=(15,1,TRAILER3=(16,54))                             




Gerry
Back to top
View user's profile Send private message
sreejeshcs

New User


Joined: 28 May 2007
Posts: 31
Location: Pune

PostPosted: Mon Nov 04, 2013 1:30 pm
Reply with quote

Its working icon_smile.gif

What to do if I need to present 7 rows in one line. ?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Nov 04, 2013 2:12 pm
Reply with quote

Work out how this one is working. Then you'll know what to do for seven.
Back to top
View user's profile Send private message
sreejeshcs

New User


Joined: 28 May 2007
Posts: 31
Location: Pune

PostPosted: Mon Nov 04, 2013 9:19 pm
Reply with quote

Can some one explain, the below 2 lines. I made changes but getting error in below 2 lines.

OUTFIL REMOVECC,NODETAIL,BUILD=(16,54),
SECTIONS=(15,1,TRAILER3=(16,54))
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Nov 04, 2013 10:04 pm
Reply with quote

1 - What error? Show it.
2 - REMOVECC, I believe, stands for REMOVE Carriage Control i.e. remove any printer control characters in column 1. The rest I do not know well enough to say but I m not going to look up the manual because you can do that yourself.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Nov 04, 2013 10:20 pm
Reply with quote

OUTFIL REMOVECC,NODETAIL,BUILD=(16,54),
SECTIONS=(15,1,TRAILER3=(16,54))

REMOVECC - as NicC says
NODETAIL - don't show detail lines, only HEADERn/TRAILERn lines
SECTIONS - define a section of a report, based on a control field, with HEADER3/TRAILER3 available
BUILD - I'm sure you know. I don't think it is necessary here (make that part of your investigation and let us know)

Gerry defined a GROUP with an ID, and the report produced (SECTIONS is a reporting feature, as are HEADERn/TRAILERn, hence the Printer Control Character in the first place) is your output file of "total lines". The TRAILER3 record simply contains bytes from position 16 for a length of 54 from the last record in the group..
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top