Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Set a return code if input dataset has 2 hdrs and 2 Trls

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
sudhamani

New User


Joined: 08 Nov 2007
Posts: 5
Location: india

PostPosted: Fri May 09, 2008 8:50 pm    Post subject: Set a return code if input dataset has 2 hdrs and 2 Trls
Reply with quote

hi ,

Is there any utility that can be implemented for the below requirment.

I need to set a return code if the input dataset contains 2 headers or 2 trailers.


thanks
Back to top
View user's profile Send private message
References
PostPosted: Fri May 09, 2008 8:50 pm    Post subject: Re: Set a return code if input dataset has 2 hdrs and 2 Trls Reply with quote

sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 135
Location: hyderabad

PostPosted: Fri May 09, 2008 8:55 pm    Post subject:
Reply with quote

sudhamani,
You can.Please post your sample input and file stats.

Thanks
Krishy
Back to top
View user's profile Send private message
sudhamani

New User


Joined: 08 Nov 2007
Posts: 5
Location: india

PostPosted: Fri May 09, 2008 10:13 pm    Post subject:
Reply with quote

the input file will have two headers like

H200804071058

detail records...................

triler records....................

H200804071058
detail.......
trailerr...
if it is having two headers or two trailers we need to set return code to abend the job.

thanks
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 688
Location: Virginia, USA

PostPosted: Fri May 09, 2008 10:23 pm    Post subject:
Reply with quote

How are the trailers identified? What are the record lengths and format (fixed or variable)?
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 135
Location: hyderabad

PostPosted: Sat May 10, 2008 12:34 am    Post subject:
Reply with quote

Sudhamani,
Check the below code.


Code:

//S1    EXEC  PGM=SYNCTOOL                                   
//TOOLMSG DD SYSOUT=*                                       
//DFSMSG  DD SYSOUT=*                                       
//IN0 DD *                                                   
HEADER                                                       
ABCDEFGGGGG                                                 
DEF                                                         
TRAILER                                                     
HEADER                                                       
ABCDEFGGGGG                                                 
DEF                                                         
TRAILER                                                     
//IN1 DD DSN=XXXXXXX.T3,UNIT=SYSDK,SPACE=(CYL,(6,6)),       
//       DISP=(NEW,CATLG,DELETE),DCB=(RECFM=FBA,LRECL=80)   
//OUT DD DSN=XXXXXXX.T4,UNIT=SYSDK,SPACE=(CYL,(6,6)),       
//       DISP=(NEW,CATLG,DELETE),DCB=(RECFM=FB,LRECL=80)     
//TOOLIN DD *                                               
SORT FROM(IN0) TO(IN1) USING(CTL0)                           
OCCUR FROM(IN1) LIST(OUT) NOHEADER BLANK -                   
  ON(1,5,CH) ON(VALCNT,U04)                                 
SORT FROM(OUT) TO(IN1) USING(CTL1)                           
/*                                                           
//CTL0CNTL DD *                                             
   OPTION COPY                                               
   INCLUDE COND=(1,6,CH,EQ,C'HEADER',OR,1,7,CH,EQ,C'TRAILER')
//CTL1CNTL DD *                                             
  OPTION NULLOUT=RC16                                       
  SORT FIELDS=COPY                                         
  INCLUDE COND=((2,5,CH,NE,C'HEADE',AND,14,1,CH,NE,C'2'),OR,
                (2,5,CH,NE,C'TRAIL',AND,14,1,CH,NE,C'2'))   



This will give you ABENDU0016 because you have 2 header and 2 trailers.
Once you remove one header and one trailer then you can see ZERO return code.

Thanks
Krishy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 Hours
Page 1 of 1