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

Problem in removing non-numeric characters.


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

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Thu Feb 14, 2008 4:17 pm
Reply with quote

All,

I have a requirement of removing non-numeric characters from my input file. It starts from byte 31 and ends in 47. i created a SORT card for this. But when i submitted the job it abended with U0016. When i checked in my spool, it says 'WER268A INREC STATEMENT : SYNTAX ERROR'.
Can any one help me out? Also, i don't want to have as many steps as the number of times checked for non-numeric.

Code:

// EXEC PGM=SORT                                               
//SORTIN DD DSN=ABC.INPUT,DISP=SHR
//SORTOUT DD DSN=ABC.OUTPUT,
//           DISP=(NEW,CATLG,DELETE),       
//           SPACE=(TRK,(500,100),RLSE),     
//           RECFM=FB,LRECL=80               
//SYSOUT DD SYSOUT=*                                           
//SYSIN DD *                                                           
 OPTION COPY                                                           
 INREC IFTHEN=(WHEN=(31,1,FS,NE,NUM),OVERLAY=(31:C' '),                 
               HIT=NEXT),                                               
       IFTHEN=(WHEN=(32,1,FS,NE,NUM),OVERLAY=(32:C' '),                 
               HIT=NEXT),                                               
       IFTHEN=(WHEN=(33,1,FS,NE,NUM),OVERLAY=(33:C' '),                 
               HIT=NEXT),                                               
       IFTHEN=(WHEN=(34,1,FS,NE,NUM),OVERLAY=(34:C' '),                 
               HIT=NEXT),                                               
       IFTHEN=(WHEN=(35,1,FS,NE,NUM),OVERLAY=(35:C' '),                 
               HIT=NEXT),                                               
       IFTHEN=(WHEN=(36,1,FS,NE,NUM),OVERLAY=(36:C' '),                 
               HIT=NEXT),                                               
       IFTHEN=(WHEN=(37,1,FS,NE,NUM),OVERLAY=(37:C' '),                 
               HIT=NEXT),                                               
       IFTHEN=(WHEN=(38,1,FS,NE,NUM),OVERLAY=(38:C' '),                 
               HIT=NEXT),                                   
       IFTHEN=(WHEN=(39,1,FS,NE,NUM),OVERLAY=(39:C' '),     
               HIT=NEXT),                                   
       IFTHEN=(WHEN=(40,1,FS,NE,NUM),OVERLAY=(40:C' '),     
               HIT=NEXT),                                   
       IFTHEN=(WHEN=(41,1,FS,NE,NUM),OVERLAY=(41:C' '),     
               HIT=NEXT),                                   
       IFTHEN=(WHEN=(42,1,FS,NE,NUM),OVERLAY=(42:C' '),     
               HIT=NEXT),                                   
       IFTHEN=(WHEN=(43,1,FS,NE,NUM),OVERLAY=(43:C' '),     
               HIT=NEXT),                                   
       IFTHEN=(WHEN=(44,1,FS,NE,NUM),OVERLAY=(44:C' '),     
               HIT=NEXT),                                   
       IFTHEN=(WHEN=(45,1,FS,NE,NUM),OVERLAY=(45:C' '),     
               HIT=NEXT),                                   
       IFTHEN=(WHEN=(46,1,FS,NE,NUM),OVERLAY=(46:C' '),     
               HIT=NEXT),                                   
       IFTHEN=(WHEN=(47,1,FS,NE,NUM),OVERLAY=(47:C' '))   
/*                                                             
//                                                   
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Feb 14, 2008 4:30 pm
Reply with quote

How about posting the sysout where the Syncsort error is shown?
Back to top
View user's profile Send private message
Agni

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Thu Feb 14, 2008 4:50 pm
Reply with quote

Hi William,

Here it goes.

Code:

SYSIN :                                                   
 OPTION COPY                                               
 OUTREC IFTHEN=(WHEN=(31,1,FS,NE,NUM),OVERLAY=(31:C' '),   
                  *                                       
               HIT=NEXT),                                 
       IFTHEN=(WHEN=(32,1,FS,NE,NUM),OVERLAY=(32:C' '),   
               HIT=NEXT),                                 
       IFTHEN=(WHEN=(33,1,FS,NE,NUM),OVERLAY=(33:C' '),   
               HIT=NEXT),                                 
       IFTHEN=(WHEN=(34,1,FS,NE,NUM),OVERLAY=(34:C' '),   
               HIT=NEXT),                                 
       .
       .
       .
       IFTHEN=(WHEN=(45,1,FS,NE,NUM),OVERLAY=(45:C' '),
                HIT=NEXT),                               
       IFTHEN=(WHEN=(46,1,FS,NE,NUM),OVERLAY=(46:C' '),
               HIT=NEXT),                               
       IFTHEN=(WHEN=(47,1,FS,NE,NUM),OVERLAY=(47:C' '))

WER268A  OUTREC STATEMENT  : SYNTAX ERROR     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000 
                       
                                 


Thanks
Agni.
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: Thu Feb 14, 2008 10:22 pm
Reply with quote

Hello,

When you posted the sysout info, the product release did not make it nto the post. It may help to know which release of the product you are running.

In additon to resolving the syntax error, i believe you may have an issue with the data as well.

Quote:
It starts from byte 31 and ends in 47
Are these all 1-byte numeric fields? If they are of multiple bytes that make up one value (i.e. say bytes 31-35 are a quantity) and those positions have 123#5, the current implementation plan would make this be "123 5" - which i believe would still be invalid.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Fri Feb 15, 2008 2:12 am
Reply with quote

Agni,

NUM is supported in SyncSort for z/OS 1.3. Please verify that you are not running an earlier release.
Back to top
View user's profile Send private message
Agni

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Fri Feb 15, 2008 2:36 pm
Reply with quote

Hi All,

I understood my requirement wrongly and i gave it wrongly in my post. Sorry about that. Actually if any of the one byte, from the byte 31 to 47 contains non-numeric character, then spaces should be moved to 31-47. This is my actual requirement. Can any one of you give SORT card for this,please?

Thanks
Agni
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Feb 15, 2008 2:56 pm
Reply with quote

Hi Agni,

Please check with the following code for your requirement.
Code:
// EXEC PGM=SORT                                       
//SYSOUT DD SYSOUT=*                                   
//SORTIN DD DSN=INFILE,DISP=SHR                                         
//SORTOUT DD DSN=OUTFILE,DISP=...                                 
//SYSIN DD *                                           
 OPTION COPY                                           
 INREC IFTHEN=(WHEN=(31,17,FS,NE,NUM),OVERLAY=(31:17X))
/*                                                     
//                                                     

Thanks,
Shankar
Back to top
View user's profile Send private message
Agni

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Tue Feb 19, 2008 9:21 am
Reply with quote

Hi Alissa,

Syncsort version in my shop is "SYNCSORT FOR Z/OS 1.2.2.2R". Is there any other way of achieving my requirement?

Thanks
Agni
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Feb 20, 2008 5:33 am
Reply with quote

Agni,

Did you try submitting the SORT jcl posted by shankar?
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed Feb 20, 2008 4:48 pm
Reply with quote

Hi Agni,
Quote:
Syncsort version in my shop is "SYNCSORT FOR Z/OS 1.2.2.2R". Is there any other way of achieving my requirement?

Please check with the following code for your requirement.
Code:
// EXEC PGM=SORT                                       
//SYSOUT DD SYSOUT=*                                   
//SORTIN DD DSN=INFILE,DISP=SHR                                         
//SORTOUT DD DSN=OUTFILE,DISP=...                                 
//SYSIN DD *                                           
 OPTION COPY                                     
 INREC IFTHEN=(WHEN=(31,01,SS,NE,C'0123456789',OR,
                     32,01,SS,NE,C'0123456789',OR,
                     33,01,SS,NE,C'0123456789',OR,
                     34,01,SS,NE,C'0123456789',OR,
                     35,01,SS,NE,C'0123456789',OR,
                     36,01,SS,NE,C'0123456789',OR,
                     37,01,SS,NE,C'0123456789',OR,
                     38,01,SS,NE,C'0123456789',OR,
                     39,01,SS,NE,C'0123456789',OR,
                     40,01,SS,NE,C'0123456789',OR,
                     41,01,SS,NE,C'0123456789',OR,
                     42,01,SS,NE,C'0123456789',OR,
                     43,01,SS,NE,C'0123456789',OR,
                     44,01,SS,NE,C'0123456789',OR,
                     45,01,SS,NE,C'0123456789',OR,
                     46,01,SS,NE,C'0123456789',OR,
                     47,01,SS,NE,C'0123456789'), 
 OVERLAY=(31:17X))
/*
//                               

Thanks,
Shankar
Back to top
View user's profile Send private message
skrishnavijay

New User


Joined: 26 Sep 2007
Posts: 25
Location: chennai

PostPosted: Thu Feb 21, 2008 2:10 pm
Reply with quote

Hi Agni,

Please find below the fileaid routine that I got from the posts.

//STEP0001 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//DD01 DD DISP=SHR,DSN=INPUT DATASET
//DD01O DD DSN=OUTPUT DATASET,
// DISP=(NEW,CATLG,DELETE),
// RECFM=..,LRECL=....,
// SPACE=....,UNIT=SYSDA
//SYSIN DD *
*
$$DD01 COPY IF=(31,17,EQN)
/*

Thanks,
Krishna
Back to top
View user's profile Send private message
Agni

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Tue Feb 26, 2008 6:13 pm
Reply with quote

Hi Shankar,

I tried your code. But it is not working properly. Please see below.

This is in the input file.
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7
                              9155-04754-09-43/
                                    1499****65/


I am getting in the output file as:

Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7
                                           -43/
                                           *65/


Please correct me if i have done something wrong.

Thanks
Agni
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: Tue Feb 26, 2008 6:21 pm
Reply with quote

Agni wrote:
I tried your code. But it is not working properly.
Is the file VB?
If it is, you need to add four to the dusplacements.....35 to 51.....
Back to top
View user's profile Send private message
Agni

New User


Joined: 22 Nov 2007
Posts: 83
Location: Chennai

PostPosted: Wed Feb 27, 2008 3:22 pm
Reply with quote

Hi,

Yes, it's a VB file. I tried it and it worked fine. Thanks all.

Cheers
Agni.
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 Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top