IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To calculate the detail count in file having multiple header


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Hritam

New User


Joined: 27 Jun 2005
Posts: 36
Location: India

PostPosted: Mon Nov 02, 2009 5:21 pm
Reply with quote

Hi,
I have requirement. Here is the details as follows:

i/p file1:
---------------
10HEADER111/01/2009......
10HEADER211/01/2009......
10HEADER311/01/2009......
20DETAIL1123457..........
20DETAIL2263127..........
20DETAIL3523462..........
20DETAIL4878757..........
20DETAIL5898098..........
20DETAIL6451234..........
20DETAIL7596857..........
90TRAILER000000007.....

Expected o/p file name:
=================
10HEADER111/01/2009......
20DETAIL1123457..........
20DETAIL2263127..........
20DETAIL3523462..........
20DETAIL4878757..........
20DETAIL5898098..........
20DETAIL6451234..........
20DETAIL7596857..........
90TRAILER000000007.....

i/p and o/p record length = 900

Can you help me to find the answer.
I am not able to use IFTHEN WHEN=init as I need to exclude the headers. And not sure of the count of Headers in the file.
A pointer will be appreciated.

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

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Nov 02, 2009 6:42 pm
Reply with quote

Hi,

If I understand the requirement properly,

This code might work,

Code:
//XK89COP1 JOB ,'KRATOS',CLASS=4,MSGCLASS=Y,NOTIFY=&SYSUID
//S1       EXEC  PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN1      DD DSN=XK89.SORTIN,DISP=SHR                     
//TEMP1    DD DSN=XK89.SORTOUT,DISP=MOD                   
//TOOLIN   DD *                                           
 SUBSET FROM(IN1) TO(TEMP1) INPUT KEEP FIRST(1)           
 COPY FROM(IN1) TO(TEMP1) USING(CTL1)                     
/*                                                         
//CTL1CNTL DD *                                           
  OMIT COND=(1,1,CH,EQ,C'1')                               
/* 


Hope this helps icon_biggrin.gif


P.S - Sortout step uses disp=mod, so you may want to add a DUMMY IDCAMS copy step in front of this step to clear sortout file.
Regards,
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Nov 02, 2009 9:10 pm
Reply with quote

Hritam,

I assume you are trying to remove all headers expect the first one and that each header can be identified by a '01' at pos 1-2. You may give the below SyncSort job a try. (Untested)

Code:
//S1       EXEC  PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN= Input file....FB/900
//SORTIN   DD DSN= Output file...FB/900
//SYSIN    DD *                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(901:8C'0')),
        IFTHEN=(WHEN=(1,2,CH,EQ,C'01'),OVERLAY=(901:SEQNUM,8,ZD))
  SORT FIELDS=COPY
  OUTFIL OMIT=(901,8,ZD,GT,1),BUILD=(1,900)
/* 
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Nov 02, 2009 9:16 pm
Reply with quote

Hi Arun,


Quote:
You may give the below SyncSort job a try. (Untested)


I am not aware of Syncsort, But are these really sync sort control statements, cos they appear more like DFSORT ones.

Thanks,
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Mon Nov 02, 2009 9:23 pm
Reply with quote

Quote:
I am not aware of Syncsort, But are these really sync sort control statements, cos they appear more like DFSORT ones
SyncSort and DFSORT are competitive products. Most of the basic keywords will work the same way in each of these products.

omg. I just noticed a typo in my previous post. Please read the below line
Code:
//SORTIN   DD DSN= Output file...FB/900
as
Code:
//SORTOUT   DD DSN= Output file...FB/900
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Nov 02, 2009 9:25 pm
Reply with quote

Hi,

Thanks for the information.

They are strikingly similar. icon_eek.gif

Regards,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Nov 02, 2009 9:27 pm
Reply with quote

Hello,

If you look at the informational output from a sort, the product name will be there.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top