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: 1456
Location: Azeroth

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: 2177
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: 1456
Location: Azeroth

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: 2177
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: 1456
Location: Azeroth

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 Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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