Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - To add apostrophes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - To add apostrophes
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue May 25, 2010 1:57 pm    Post subject: Reply to: To add apostrophes
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

Site Director


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

PostPosted: Tue May 25, 2010 10:03 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 25, 2010 11:45 pm    Post subject: Reply to: Syncsort - To add apostrophes
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: 2165
Location: @my desk

PostPosted: Wed May 26, 2010 4:10 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Syncsort version supporting FINDREP c... juares castro SYNCSORT 9 Tue Aug 09, 2016 6:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us