View previous topic :: View next topic
|
Author |
Message |
rswathi_1208
New User
Joined: 14 May 2010 Posts: 11 Location: chennai
|
|
|
|
I have my input file in the following way
Code: |
1234567899
2345677788 |
I want my output to be
Code: |
'1234567899',
'2345677788'
|
Please help |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Try this sysin for SORT.
input LRECL=10
output LRECL=12
Code: |
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'''',1,10,C'''')
/*
|
|
|
Back to top |
|
|
rswathi_1208
New User
Joined: 14 May 2010 Posts: 11 Location: chennai
|
|
|
|
Thank you Sambhaji...it worked but I want to add Comma at the last of all the records except the last record. |
|
Back to top |
|
|
rswathi_1208
New User
Joined: 14 May 2010 Posts: 11 Location: chennai
|
|
|
|
I used the following control card but the comma is appending on the last record also
OPTION COPY
INREC BUILD=(C'''',1,10,C'''',C',')
SORT FIELDS=(1,12,CH,A) |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
1234567899
2345677788
1234567899
/*
//TMP DD DSN=&TEMP1,DISP=(NEW,PASS),LRECL=12
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) TO(TMP) USING(CTL1)
DATASORT FROM(TMP) TO(OUT) LAST USING(CTL2)
/*
//CTL1CNTL DD *
INREC BUILD=(C'''',1,10,C'''')
SORT FIELDS=(1,12,CH,A)
/*
//CTL2CNTL DD *
SORT FIELDS=(1,12,CH,A)
INREC OVERLAY=(13:C',')
/*
|
|
|
Back to top |
|
|
rswathi_1208
New User
Joined: 14 May 2010 Posts: 11 Location: chennai
|
|
|
|
For the above control card I am getting an error like this
SYT000I SYNCTOOL RELEASE 1.6.0 - COPYRIGHT 2007 SYNCSORT INC.
SYT001I INITIAL PROCESSING MODE IS "STOP"
SYT002I "TOOLIN" INTERFACE BEING USED
COPY FROM(IN) TO(TMP) USING(CTL1)
SYT020I SYNCSORT CALLED WITH IDENTIFIER "0001"
SYT030I OPERATION COMPLETED WITH RETURN CODE 0
DATASORT FROM(TMP) TO(OUT) LAST USING(CTL2)
SYT048E STATEMENT DOES NOT BEGIN WITH A VALID OPERATOR
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
SYT004I SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 12 |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
You dont have DFSORT\ICETOOL but SYNCSORT\SYNCTOOL installed.
Above solution provided is for DFSORT\ICETOOL |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
since You posted to DFSORT section of the forums
You got a DFSORT tested solution!
by posting to the right forum section You will make everybody happy
people will not waste time on useless replies
You will get better an more timely answers
moved where it belongs |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you start by moving the control statements out of pos 1. . . |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
dick scherrer wrote: |
Hello,
Suggest you start by moving the control statements out of pos 1. . . |
Dick,
I think SYCTOOLS allows that. Error is for not having recent release which supports DATASORT. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Sambhaji,
Thanks.
From long habit, i just keep the first 2 positions blank and posted regarding this
d |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
rswathi_1208,
You dont really need multiple passes to achieve this. You can add a HEADER and TRAILER record to check for some non-existent value as below. This is untested, still you can give it a try.
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Input file
//SORTOUT DD DSN=Output file
//SYSIN DD *
OPTION COPY
INREC BUILD=(C'''',1,10,C''',',80:X)
OUTFIL HEADER1=(C'(''XXXXXXXXXX'','),
TRAILER1=(C'''XXXXXXXXXX'')') |
|
|
Back to top |
|
|
|