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 check for character in a numeric field and replace

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
piyush_katariya

New User


Joined: 14 Jan 2008
Posts: 3
Location: india

PostPosted: Tue Jan 15, 2008 7:30 pm    Post subject: SYNCSORT check for character in a numeric field and replace
Reply with quote

I want to check if a character is present in a 8 byte numeric field using SYNCSORT. If a character is found then move c'00000000' in that field. else keep it as it is.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jan 15, 2008 9:56 pm    Post subject:
Reply with quote

Code:
//*******************************************************
//STEP1    EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
12345678                                                 
A23456 8                                                 
12345678                                                 
123456 8                                                 
12345678                                                 
12345678                                                 
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                       
  INREC IFTHEN=(WHEN=(1,1,SS,NE,C'0,1,2,3,4,5,6,7,8,9'),
        OVERLAY=(1:8C'0')),                               
        IFTHEN=(WHEN=(2,1,SS,NE,C'0,1,2,3,4,5,6,7,8,9'),
        OVERLAY=(1:8C'0')),                               
        IFTHEN=(WHEN=(3,1,SS,NE,C'0,1,2,3,4,5,6,7,8,9'),
        OVERLAY=(1:8C'0')),                               
        IFTHEN=(WHEN=(4,1,SS,NE,C'0,1,2,3,4,5,6,7,8,9'), 
        OVERLAY=(1:8C'0')),                               
        IFTHEN=(WHEN=(5,1,SS,NE,C'0,1,2,3,4,5,6,7,8,9'), 
        OVERLAY=(1:8C'0')),                               
        IFTHEN=(WHEN=(6,1,SS,NE,C'0,1,2,3,4,5,6,7,8,9'), 
        OVERLAY=(1:8C'0')),                               
        IFTHEN=(WHEN=(7,1,SS,NE,C'0,1,2,3,4,5,6,7,8,9'), 
        OVERLAY=(1:8C'0')),                               
        IFTHEN=(WHEN=(8,1,SS,NE,C'0,1,2,3,4,5,6,7,8,9'), 
        OVERLAY=(1:8C'0'))                                 
/*                                                         


SORTOUT
Code:
12345678 
00000000 
12345678 
00000000 
12345678 
12345678 
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jan 15, 2008 10:14 pm    Post subject:
Reply with quote

piyush_katariya,

If you happen to have access to DFSORT, you can use the NUM function to do this more easily as follows (note that the NUM function is not available with Syncsort):

Code:

//STEP1    EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
12345678                                                   
A23456 8                                                   
12345678                                                   
123456 8                                                   
12345678                                                   
12345678                                                   
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  INREC IFTHEN=(WHEN=(1,8,FS,NE,NUM),OVERLAY=(8C'0'))     
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Jan 23, 2008 4:31 am    Post subject:
Reply with quote

Frank Yaeger wrote:
(note that the NUM function is not available with Syncsort)

SyncSort for z/OS 1.3, which is now generally available, supports the NUM function.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Jan 23, 2008 1:02 pm    Post subject:
Reply with quote

Alissa Margulies wrote:
SyncSort for z/OS 1.3, which is now generally available, supports the NUM function.

Alissa, can you also mention the other features that are available as a part of SyncSort for z/OS 1.3
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Jan 23, 2008 9:01 pm    Post subject:
Reply with quote

krisprems wrote:
Alissa, can you also mention the other features that are available as a part of SyncSort for z/OS 1.3

For the complete SyncSort for z/OS 1.3 Summary of Changes, you can go to http://syncsort.lyris.net/t/654/928821/151/0/
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Jan 24, 2008 1:33 am    Post subject:
Reply with quote

Thanks for the info Alissa
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Thu Jan 24, 2008 3:29 am    Post subject:
Reply with quote

Alissa Margulies wrote:
SyncSort for z/OS 1.3, which is now generally available, supports the NUM function.


Thanks! I'll ask to my systemers for that version...we are in 1.2.
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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