View previous topic :: View next topic |
Author |
Message |
mf_user Intermediate
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Dec 12, 2008 7:20 am Post subject: Is there any mechanism possible by SORT? |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Dec 12, 2008 11:08 am Post subject: |
|
|
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 |
|
|
mf_user Intermediate
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Dec 12, 2008 1:24 pm Post subject: |
|
|
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 |
|
|
mf_user Intermediate
Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Dec 12, 2008 2:25 pm Post subject: use IDCAMS to check emptiness ! |
|
|
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 |
|
|
|
|