|
View previous topic :: View next topic
|
| Author |
Message |
sreejeshcs
New User
Joined: 28 May 2007 Posts: 31 Location: Pune
|
|
|
|
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 |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
 |
sreejeshcs
New User
Joined: 28 May 2007 Posts: 31 Location: Pune
|
|
|
|
Its working
What to do if I need to present 7 rows in one line. ? |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Work out how this one is working. Then you'll know what to do for seven. |
|
| Back to top |
|
 |
sreejeshcs
New User
Joined: 28 May 2007 Posts: 31 Location: Pune
|
|
|
|
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 |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|