Page 1 of 1

Syncsort - put start and end quotes

PostPosted: Thu Jun 20, 2013 8:54 pm
by ranga_subham
Hi,

I have a list of datasets (differ in length) and want to apply single quote on beginning and ending of each dataset.

MERIAM.KIDE1.MARE2
MERIAM.SILJA1
MERIAM.FERET1.BODE2.BAREN3


Expected Output:
'MERIAM.KIDE1.MARE2'
'MERIAM.SILJA1'
'MERIAM.FERET1.BODE2.BAREN3'


Please help.

Thanks.

Re: Syncsort - put start and end quotes

PostPosted: Thu Jun 20, 2013 11:10 pm
by BillyBoyo
Experiment with and research something like this:

 INREC OVERLAY=(1:1,44,
                JFY=(SHIFT=LEFT,
                     LEAD=C'''',
                     TRAIL=C'''''))

Re: Syncsort - put start and end quotes

PostPosted: Fri Jun 21, 2013 4:31 pm
by ranga_subham
BillyBoyo, it has worked and I got the results after removing extra single quote in TRAIL ! :D

I was over-analyzing to achieve it with PARSE :oops: but don't know if that too was possible :roll:

Thanks a lot.

Re: Syncsort - put start and end quotes

PostPosted: Fri Jun 21, 2013 6:37 pm
by ranga_subham
another way of doing it but don't know efficient than what BillyBoyo suggested :?

//SYSIN    DD *                       
 SORT FIELDS=COPY                     
 INREC FIELDS=(C'''',1,44,C'''')       
 OUTREC FIELDS=(1,46,SQZ=(SHIFT=LEFT))


How to achieve the same with PARSE though :?: :x

Thanks.