View previous topic :: View next topic |
Author |
Message |
radkrish Beginner

Joined: 12 Aug 2005 Posts: 102 Topics: 19
|
Posted: Tue Aug 29, 2006 2:58 am Post subject: Set RC in file aid |
|
|
My requirement is to abort the job if the condition is not satisfied while checking it using batch FILE-AID.
Is it possible to set/force return codes if a condition is not satisfied in batch FILE AID.pls let me know the syntax for the same.
regds,
krish |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Aug 29, 2006 4:46 am Post subject: |
|
|
radkrish,
File-aid returns a code of 08 when no records are written/copied. So use an IF condition to check for the data and if there are no records satisfying the condition the output file will be empty and the return code is 08. Now use the COND code to abort the job.
Hope this helps..
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
radkrish Beginner

Joined: 12 Aug 2005 Posts: 102 Topics: 19
|
Posted: Tue Aug 29, 2006 5:10 am Post subject: |
|
|
Thanks for the reply,kolusu.
My requirement is:
In a dataset having 200 bytes length,if there is spaces after the record length 110,then the job should be aborted.Else it should run further steps.
If there is 10 records and if any of the records having spaces after the record length 110,it should abort.It also contains header and trailer which is with in 50 bytes length.
after removing header and trailer
Code: |
$$DD01 USER IF=(101,NE,C' '),
WRITE=DD01O |
"MOVE value to return code "
Is there any such syntax in FILE-AID.
Can you pls make it clear how do you want to go about it from your stmt.
regds,
krish |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Aug 29, 2006 7:37 am Post subject: |
|
|
radkrish,
Here is an example. The input file has 2 records and in step0100 I am checking if there is any record with 'Kolusu' at 1st byte. If there is then I am copying it to the output file and the return code will be zero. In this case the job should abend. If there are no records with 'kolusu' in the 1st byte , then the return code will be 8. So this is a good condition and job should not abend. run the following job twice. 1st time as is and the second time delete the 'kolusu' record and run it. The 1st run will abend and the second run the job will NOT abend.
Code: |
//********************************************
//* SETS RC=0000 IF DATASET HAS RECORDS *
//* SETS RC=0008 IF DATASET IS EMPTY *
//********************************************
//STEP0100 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD *
KOLUSU
MVSFORUMS
//DD01O DD DUMMY
//SYSIN DD *
$$DD01 COPY IF=(1,EQ,C'KOLUSU')
//*
//***************************************************
//* IF STEP0100 RC<008 MEANS THERE ARE UNWANTED *
//* RECORDS AND THE JOB SHOULD ABEND *
//* *
//* IF STEP0100 RC=008 MEANS THERE ARE NO UNWANTED *
//* RECORDS AND JOB SHOULD NOT ABEND *
//***************************************************
//STEP0101 EXEC PGM=ABEND,
// COND=(8,EQ,STEP0100)
//*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
radkrish Beginner

Joined: 12 Aug 2005 Posts: 102 Topics: 19
|
Posted: Wed Aug 30, 2006 2:56 am Post subject: |
|
|
Thanks for the solution,Kolusu.
I abended the job by checking it thru IDCAMS after the FILEAID step.
regds,
krish |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Aug 30, 2006 7:20 am Post subject: |
|
|
Quote: |
Thanks for the solution,Kolusu.
I abended the job by checking it thru IDCAMS after the FILEAID step.
|
Why do you need an IDCAMS step once again ? Can you show how you abended with IDCAMS?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
radkrish Beginner

Joined: 12 Aug 2005 Posts: 102 Topics: 19
|
Posted: Wed Aug 30, 2006 8:39 am Post subject: |
|
|
I was abt to convey that I used the alternate one.Sorry,I probably made you to misunderstood.Your solution proves better.
Thanks!
regds,
krish |
|
Back to top |
|
 |
|
|