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
 

 

To calculate the detail count in file having multiple header

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: To calculate the detail count in file having multiple header
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: 1476
Location: Chennai

PostPosted: Mon Nov 02, 2009 6:42 pm    Post subject:
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: 2239
Location: @my desk

PostPosted: Mon Nov 02, 2009 9:10 pm    Post subject:
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: 1476
Location: Chennai

PostPosted: Mon Nov 02, 2009 9:16 pm    Post subject:
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: 2239
Location: @my desk

PostPosted: Mon Nov 02, 2009 9:23 pm    Post subject:
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: 1476
Location: Chennai

PostPosted: Mon Nov 02, 2009 9:25 pm    Post subject:
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

Site Director


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

PostPosted: Mon Nov 02, 2009 9:27 pm    Post subject:
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    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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm


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