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

Quotation Convertion in Sort


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

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Mon Jun 28, 2010 1:24 am
Reply with quote

Hi,

Can anyone help me in converting the Single Quotation to Space in Sort

I tried using below Sort card but couldn't succed

Code:
//SYSIN    DD  *                                               
    SORT FIELDS=(5,20,CH,A)                                     
    OUTREC  IFTHEN=(WHEN=(10,1,CH,EQ,C"'"),OVERLAY=(10:C" ")), 
            IFTHEN=(WHEN=(11,1,CH,EQ,C"'"),OVERLAY=(11:C" ")), 
            IFTHEN=(WHEN=(12,1,CH,EQ,C"'"),OVERLAY=(12:C" "))   


Getting a Syntax error message as

Code:
SYNCSORT LICENSED             
SYSIN :                                                                   
    SORT FIELDS=(5,20,CH,A)                                               
    OUTREC  IFTHEN=(WHEN=(10,1,CH,EQ,C"'"),OVERLAY=(10:C" ")),           
                                                                       * 
            IFTHEN=(WHEN=(11,1,CH,EQ,C"'"),OVERLAY=(11:C" ")),           
            *                                                             
            IFTHEN=(WHEN=(12,1,CH,EQ,C"'"),OVERLAY=(12:C" "))             
WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                 
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                             
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                           


Some one help me whether we can convert the Single Quotation in Sort card.

Thanks
Ashwin
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Jun 28, 2010 2:09 am
Reply with quote

ashwinreddy wrote:
Code:
SYNCSORT LICENSED             
SYSIN :                                                                   
    SORT FIELDS=(5,20,CH,A)                                               
    OUTREC  IFTHEN=(WHEN=(10,1,CH,EQ,C"'"),OVERLAY=(10:C" ")),           
                                                                       * 
            IFTHEN=(WHEN=(11,1,CH,EQ,C"'"),OVERLAY=(11:C" ")),           
            *                                                             
            IFTHEN=(WHEN=(12,1,CH,EQ,C"'"),OVERLAY=(12:C" "))             
WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                 
WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                           
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                             
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                           


Some one help me whether we can convert the Single Quotation in Sort card.
With your attempt to align the '*'s, I can't tell what is wrong except the error seems to be complaining about "NO KEYWORDS" rather than some problem with the quotes....

Please re-post the error sysout and DO NOT attempt to adjust it, just wrap the "code" around it.
At the same time, please include the version/release information in that sysout.
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Mon Jun 28, 2010 3:47 am
Reply with quote

Below is the Full Jcl

Code:


//STEP2  EXEC  PGM=SYNCSORT                                     
//SYSOUT   DD  SYSOUT=*                                         
//SORTIN   DD  DISP=SHR,DSN=CLST.TEST.SCL.INFO.D062510.FNL.V01   
//SORTOUT  DD  DSN=CLST.TEST.SCL.INFO.D062510.FNL.V02,           
//             UNIT=SYSDA,DISP=(NEW,CATLG,DELETE),DATACLAS=MB010,
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)                 
//SYSIN    DD  *                                                 
    SORT FIELDS=(5,20,CH,A)                                     
    OUTREC  IFTHEN=(WHEN=(10,1,CH,EQ,C"'"),OVERLAY=(10:C" ")),   
            IFTHEN=(WHEN=(11,1,CH,EQ,C"'"),OVERLAY=(11:C" ")),   
            IFTHEN=(WHEN=(12,1,CH,EQ,C"'"),OVERLAY=(12:C" "))   
/*                                                               



And Spool

Code:


 SYNCSORT FOR Z/OS  1.3.2.0R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SY
                                                       z/OS   1.10.0       
  SYSIN :                                                                   
     SORT FIELDS=(5,20,CH,A)                                               
     OUTREC  IFTHEN=(WHEN=(10,1,CH,EQ,C"'"),OVERLAY=(10:C" ")),             
                                                                        *   
             IFTHEN=(WHEN=(11,1,CH,EQ,C"'"),OVERLAY=(11:C" ")),             
             *                                                             
             IFTHEN=(WHEN=(12,1,CH,EQ,C"'"),OVERLAY=(12:C" "))             
 WER268A  OUTREC STATEMENT  : SYNTAX ERROR                                 
 WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT                           
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                             
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE



I used same sort card sometime back to convert a character, but not sure whether we can convert a Quotation. And * indicates some error in the syntax and confused as am sure this syntax is good (as used earlier).

Please correct me if am wrong.

Thanks
Ashwin
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Jun 28, 2010 5:05 am
Reply with quote

Hi,

try this
Code:
    SORT FIELDS=(5,20,CH,A)                                     
    OUTREC  IFTHEN=(WHEN=(10,1,CH,EQ,C''''),OVERLAY=(10:C' ')), 
            IFTHEN=(WHEN=(11,1,CH,EQ,C''''),OVERLAY=(11:C' ')), 
            IFTHEN=(WHEN=(12,1,CH,EQ,C''''),OVERLAY=(12:C' '))   



Gerry
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Jun 28, 2010 5:23 am
Reply with quote

Yes, I'm kinda thinking that way, since
SyncSort for z/OS 1.2 Programmer’s Guide wrote:
An apostrophe within a literal string must be specified with a double apostrophe (e.g., C'O''LEARY').
I am having problems finding my 1.3.2 manual and the equivalent definition of DFSort's reference to PAIR=APOST vs PAIR=QUOTE....
Back to top
View user's profile Send private message
ashwinreddy

Active User


Joined: 16 Sep 2004
Posts: 106
Location: Hyderabad

PostPosted: Mon Jun 28, 2010 5:59 am
Reply with quote

Thanks all.

It worked.

Thanks
Ashwin
Back to top
View user's profile Send private message
keyarika

New User


Joined: 24 May 2008
Posts: 10
Location: bangalore

PostPosted: Mon Jun 28, 2010 12:35 pm
Reply with quote

Hi,

In case, the 'Single Quote' is present in all three position (10, 11 & 12) in single record and you want to change all of them then use HIT=NEXT

Code:
OUTREC  IFTHEN=(WHEN=(10,1,CH,EQ,C''''),OVERLAY=(10:C' ')),HIT=NEXT, 
        IFTHEN=(WHEN=(11,1,CH,EQ,C''''),OVERLAY=(11:C' ')),HIT=NEXT, 
        IFTHEN=(WHEN=(12,1,CH,EQ,C''''),OVERLAY=(12:C' '))
Code'd
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top