MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Is there any mechanism possible by SORT?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Dec 12, 2008 7:20 am    Post subject: Is there any mechanism possible by SORT? Reply with quote

Hi,

We have an input file that is produced by a job and goes downstream. This file should NOT have values '000' or '999' in 30th column. If it has then the job that receives this file as input abends.

Can we have a mechanism by using SORT where a precheck is done on this file to see if there are any such records with '000' or '999' in 30th position of input file and give some kind of return code or something?

Also, please suggest if the file has records with '000' or '999' in 30th positions then find all of them and strip them off to create a new input file to pass on !?

Please suggest.

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Dec 12, 2008 11:08 am    Post subject: Reply with quote

mf_user,

You can split the good and bad records into different files. Once split check if the bad file is empty or not and set the return code of your choice.

Code:

//STEP0100 EXEC PGM=ICEMAN                         
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                     
RECORD 01                    000                   
RECORD 02                                           
RECORD 03                                           
RECORD 04                                           
RECORD 05                    999                   
//GOOD     DD SYSOUT=*                             
//BAD      DD SYSOUT=*                             
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                 
  OUTFIL FNAMES=BAD,INCLUDE=(30,3,SS,EQ,C'000,999')
  OUTFIL FNAMES=GOOD,SAVE                           
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Dec 12, 2008 1:24 pm    Post subject: Reply with quote

Thanks a lot Kolusu.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Dec 12, 2008 2:25 pm    Post subject: use IDCAMS to check emptiness ! Reply with quote

Hi,

I thought I can go for below code with IDCAMS to do empty check.

Code:

//SYSIN    DD *                               
  REPRO INFILE(FILE01) OUTFILE(FILE02) COUNT(1)
/*                                             


Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group