Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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 & VSAM
View previous topic :: :: View next topic  
Author Message
sudhamani

New User


Joined: 08 Nov 2007
Posts: 19
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

sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 182
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: 19
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: 1512
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: 182
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
sudhamani

New User


Joined: 08 Nov 2007
Posts: 19
Location: india

PostPosted: Mon May 12, 2008 1:54 pm    Post subject:
Reply with quote

hi Krishy ,



could you please explain the above code.as my header format is H200804071058.


thanks
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 182
Location: hyderabad

PostPosted: Mon May 12, 2008 4:15 pm    Post subject:
Reply with quote

Please proivde the sample input of the records and the expected output.

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

New User


Joined: 08 Nov 2007
Posts: 19
Location: india

PostPosted: Mon May 12, 2008 4:44 pm    Post subject:
Reply with quote

hi

below are the sample example for the input file

H200711051317
T20080107105000000000000000
H200805051115
MCD200804210011939 00000000010
D00000000000000000000000006490
........
.......
.......

we can see 2 headers H200711051317 and H200805051115 here

I want to check if record type with 'H' are 2 then set some return code.


thanks
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 182
Location: hyderabad

PostPosted: Mon May 12, 2008 5:33 pm    Post subject:
Reply with quote

sudhamani,

Please check the below code.

Code:

//S1    EXEC  PGM=SYNCTOOL                                   
//TOOLMSG DD SYSOUT=*                                       
//DFSMSG  DD SYSOUT=*                                       
//IN0 DD *                                                   
H200711051317                                               
T20080107105000000000000000                                 
MCD200804210011939 00000000010                               
H200711051317                                               
D00000000000000000000000006490                               
//IN1 DD DSN=xxxx.T3,UNIT=SPK,SPACE=(CYL,(6,6)),       
//       DISP=(NEW,CATLG,DELETE),DCB=(RECFM=FBA,LRECL=80)   
//OUT DD DSN=xxxxx.T4,UNIT=SPK,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,1,CH) ON(VALCNT,U04)                                 
SORT FROM(OUT) TO(IN1) USING(CTL1)                           
/*                                                           
//CTL0CNTL DD *                                             
   OPTION COPY                                               
   INCLUDE COND=(1,1,CH,EQ,C'H')                             
//CTL1CNTL DD *                                             
  OPTION NULLOUT=RC16                                       
  SORT FIELDS=COPY                                           
  INCLUDE COND=(10,1,CH,NE,C'2')                             



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

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon May 12, 2008 6:57 pm    Post subject:
Reply with quote

the below solution is using SYNCSORT,

Code:
//*******************************************************
//S1       EXEC  PGM=ICEMAN                             
//SORTIN   DD *                                         
H200804071058                                           
DETAIL RECORDS...................                       
TRILER RECORDS....................                       
H200804071058                                           
DETAIL.......                                           
TRILER RECORDS....................                       
/*                                                       
//HEAD    DD DUMMY                                       
//TAIL    DD DUMMY                                       
//SYSOUT  DD SYSOUT=*                                   
//SYSIN   DD *                                           
      INCLUDE COND=(1,1,SS,EQ,C'H,T')                   
      INREC OVERLAY=(2:C'1')                             
      SORT FIELDS=(1,1,CH,A)                             
      SUM FIELDS=(2,1,ZD)                               
      OUTFIL FNAMES=HEAD,NULLOFL=RC4,                   
      INCLUDE=(1,1,CH,EQ,C'H',&,2,1,ZD,EQ,1)             
      OUTFIL FNAMES=TAIL,NULLOFL=RC4,                   
      INCLUDE=(1,1,CH,EQ,C'T',&,2,1,ZD,EQ,1)             
Back to top
View user's profile Send private message
sudhamani

New User


Joined: 08 Nov 2007
Posts: 19
Location: india

PostPosted: Thu May 15, 2008 4:42 pm    Post subject:
Reply with quote

hi

thank you
this functionality is working but small confusion with code.
colud you please explain the below 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'))




thanks
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 182
Location: hyderabad

PostPosted: Thu May 15, 2008 4:53 pm    Post subject:
Reply with quote

sudhamani,
1)The fisrt SORT card with CTL0CNTL will check and place all the HEADER and TRAILER records.
2)The OCCURS will place the count of HEADER And Trailer records.
3)The 3 rd SORT card will check for the count of header and trailer and gives return code depending on the count.

But,krisprems soultion is better and efficient as it is having less passes of data than what I have shown.

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

New User


Joined: 08 Nov 2007
Posts: 19
Location: india

PostPosted: Thu May 15, 2008 5:21 pm    Post subject:
Reply with quote

hi,

could you please breifly go through CTL1CNTL SORT and condition of checking with notequal to.
because i am facing difficulty with checking for 3 or more than 3 headers from the input file .

Thanks for your help.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts Formating the Input file sreekusr DFSORT/ICETOOL 3 Fri Feb 17, 2017 10:40 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us