Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
Hi Frank, thanks for your response. I am getting a SYNTAX error for this./
can u please take a look..
Code:
SYNCSORT FOR Z/OS 1.3.0.0R U.S. PATENTS: 4210961, 5117495 (C)
z/OS 1.7.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER xxxxx, MODEL 2096 S04
SYSIN :
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(151:SEQNUM,3,ZD,RESTART=(2,6))),
IFTHEN=(WHEN=GROUP,BEGIN=(151,3,ZD,EQ,1),
*
PUSH=(154:8,3))
OUTFIL OMIT=(154,3,CH,EQ,C'000'),
BUILD=(1,150)
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
The job works fine with DFSORT. The WER messages indicate you're using Syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Support for WHEN=GROUP was included in SyncSort for z/OS 1.3.2.0. The syntax error you are encountering is due to the fact that you are running an earlier release of the product. For information regarding upgrading to the current release, please contact me offline at alissa.margulies@syncsort.com (it's free!)
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
genesis786,
Just a couple of questions regarding your requirement.
1. Does the subheader field for a particular account always start with either a '000' or a '001'? Can it start with some other value like '003'?
2. Are the subheader field values in your 'real' file, sequence numbers as shown in your sample data(001,002,003..)? Can it be out of sequence for an account ? Is the below scenario possible?
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
genesis786,
Here's a Syncsort job which I think would work for your version. I dont have access to mainframe and cant test this now. May be you can give this a try and let us know the results. Good luck