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 

Set RC in file aid

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


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Tue Aug 29, 2006 2:58 am    Post subject: Set RC in file aid Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Aug 29, 2006 4:46 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Tue Aug 29, 2006 5:10 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Aug 29, 2006 7:37 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Wed Aug 30, 2006 2:56 am    Post subject: Reply with quote

Thanks for the solution,Kolusu.
I abended the job by checking it thru IDCAMS after the FILEAID step.

regds,
krish
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Aug 30, 2006 7:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Wed Aug 30, 2006 8:39 am    Post subject: Reply with quote

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
View user's profile Send private message
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