View previous topic :: View next topic
Author
Message
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
I have a file with length 311.
I have to split this file in to 2 separate files based on the key in the first positions.
This is the i/p file
Code:
1234 asdfgfhnmffhnm
3221 SdfaSGfhdgndgnmxfgnh
1234SgfSGhgd
3221asdafasdfs
first o/p file should contain,that is only the records having the KEY value 1234
Code:
1234 asdfgfhnmffhnm
1234SgfSGhgd
second o/p file should have, the records which have the key value
Code:
3221 SdfaSGfhdgndgnmxfgnh
3221asdafasdfs
In my real scenario i have to create 3 o/p files based on the keys. What ever i have shown here is an example only.
I am facing difficulties because of RDW. please help me...
Back to top
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
sorry i missed the main part of my problem...
the output file should have key value at all
the file 1 should look like
Code:
asdfgfhnmffhnm
SgfSGhgd
file 2 shd look like
Code:
SdfaSGfhdgndgnmxfgnh
asdafasdfs
Back to top
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
the i/p file format is VB and lrecl is 311
the 1st o/p file is VB and lrecl 50
2nd o/p file is VB and lrecl 90
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Here's a DFSORT job that will do what you asked for:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB/311)
//OUT1 DD LRECL=50,DSN=... output file1 (VB/50)
//OUT2 DD LRECL=90,DSN=... output file2 (VB/90)
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT1,
INCLUDE=(5,4,CH,EQ,C'1234'),
BUILD=(1,4,5:9)
OUTFIL FNAMES=OUT2,
INCLUDE=(5,4,CH,EQ,C'3221'),
BUILD=(1,4,5:9)
/*
Back to top
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
I get the error
Code:
OUT1 HAS INCOMPATIBLE LRECL
is there anything to do with NOSOLRF or some thing...
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
That's a Syncsort message.
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.
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
krisprems,
Try this:
Code:
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,
INCLUDE=(5,4,CH,EQ,C'1234'),
IFTHEN=(WHEN=(1,2,BI,LT,54),
BUILD=(1,4,9)),IFOUTLEN=50,
IFTHEN=(WHEN=(1,2,BI,GE,54),
BUILD=(1,4,9,46))
OUTFIL FILES=02,
INCLUDE=(5,4,CH,EQ,C'3221'),
IFTHEN=(WHEN=(1,2,BI,LT,94),
BUILD=(1,4,9)),IFOUTLEN=90,
IFTHEN=(WHEN=(1,2,BI,GE,94),
BUILD=(1,4,9,86))
/*
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
krisprems,
Please note, if you are using my control cards as is, you'll need to change the OUT1 and OUT2 DDs to SORTOF01 and SORTOF02.
Back to top
krisprems Active Member Joined: 27 Nov 2006Posts: 649 Location: India
Thanks Frank and Alissa.
Alissa: i used ur sort card, it worked for me...
Back to top
Please enable JavaScript!