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

Syncsort - To add apostrophes


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

New User


Joined: 14 May 2010
Posts: 11
Location: chennai

PostPosted: Tue May 25, 2010 12:06 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Tue May 25, 2010 12:13 pm
Reply with quote

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
View user's profile Send private message
rswathi_1208

New User


Joined: 14 May 2010
Posts: 11
Location: chennai

PostPosted: Tue May 25, 2010 12:20 pm
Reply with quote

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
View user's profile Send private message
rswathi_1208

New User


Joined: 14 May 2010
Posts: 11
Location: chennai

PostPosted: Tue May 25, 2010 12:24 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Tue May 25, 2010 12:57 pm
Reply with quote

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
View user's profile Send private message
rswathi_1208

New User


Joined: 14 May 2010
Posts: 11
Location: chennai

PostPosted: Tue May 25, 2010 1:52 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Tue May 25, 2010 1:56 pm
Reply with quote

You dont have DFSORT\ICETOOL but SYNCSORT\SYNCTOOL installed.

Above solution provided is for DFSORT\ICETOOL
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue May 25, 2010 1:57 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue May 25, 2010 10:03 pm
Reply with quote

Hello,

Suggest you start by moving the control statements out of pos 1. . .
Back to top
View user's profile Send private message
Escapa

Senior Member


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

PostPosted: Tue May 25, 2010 11:11 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue May 25, 2010 11:45 pm
Reply with quote

Hi Sambhaji,

Thanks.

From long habit, i just keep the first 2 positions blank and posted regarding this icon_wink.gif

d
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed May 26, 2010 4:10 pm
Reply with quote

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
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 Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top