Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Are the records really numbered like that and is the record to be selected indicated by a number? Or is it more complicated than that? If so, then please give a more accurate description of the input records (real values) and how you identify the specified record (real value or relative record number or ?).
Also, where are N=1 and 4 found - are they values you will hardcode, or in a file, or what?
Are you only looking for one set of records (e.g. 3-5, or are you really looking for multiple sets of records (e.g. 3-5, 9-11 and 21-23)?
The records are more complicated than that mentioned above.. actually, the file contains much account information. and the using account number as the Key(S(19))..
my aim is. according to the given account number, to sort out records before and after that account... because the file contains more 1 million records, and record length is more than 60,000 byte. I hope this helps...
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You still haven't described what you're trying to do in enough detail for me to help you. You didn't answer my question about whether you're looking for one set of records or multiple sets of records, or how you specify the needed information about the target account and "spread". It isn't clear if you want to extract the records before or after they are sorted (or even if you want them sorted).
Quote:
record length is more than 60,000 byte
Huh? DFSORT cannot handle files with records that big. What type of file is it? What are its attributes (RECFM? LRECL?).
Are you only looking for one set of records (e.g. 3-5, or are you really looking for multiple sets of records (e.g. 3-5, 9-11 and 21-23)?
I just looking for one set of records at one time.
Code:
It isn't clear if you want to extract the records before or after they are sorted (or even if you want them sorted).
This file is KSDS, account number(1:19) as the key value..
Quote:
DFSORT cannot handle files with records that big. What type of file is it? What are its attributes (RECFM? LRECL?).
Made a type error.. the RECFM is FB, and LRECL=6549,not more than 60,000 as i typed before.. thanks...
as discussed, I am just looking for a set of records.
hope clear now...
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Here's a DFSORT/ICETOOL job that will do what you asked for. It will work fine unless you don't have the number of records specified before the target record (for example, if you ask for record 2 with N=+2) - that could be fixed, but I didn't bother at this point since I don't know if you will ever have that situation.
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYMNAMES DD *
* Specify target account number as string
TARGACCT,'1234567890123456789'
* Specify number of records before and after as +d (+ is required)
N,+1
/*
//IN DD DSN=... input file (FB)
//CTL2CNTL DD DSN=&&C1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//OUT DD DSN=... output file (FB)
//TOOLIN DD *
COPY FROM(IN) TO(CTL2CNTL) USING(CTL1)
COPY FROM(IN) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
INREC OVERLAY=(20:SEQNUM,8,ZD)
OUTFIL FNAMES=CTL2CNTL,
INCLUDE=(1,19,CH,EQ,TARGACCT),
BUILD=(C' OPTION SKIPREC=',
20,8,ZD,SUB,N,SUB,+1,TO=ZD,LENGTH=8,
C',STOPAFT=',N,ADD,N,ADD,+1,TO=ZD,LENGTH=8,80:X)
/*
I don't think this is going to please Frank since you are using SYNCSORT which is the competitor to DFSORT
Choose DFSORT or SYNCSORT? it's not decided by me. actually, i have no idea what's difference between them.. seems to me, there's no syntax difference between them...
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
Hi,
WER messages belong to SYNCSORT
ICE messages belong to DFSORT
As they are in opposition they try to provide the same functionalities.
Surely you dont expect a person working for a particular company who's trying to flog their product assisting you with someone using their competitor's product.
Surely you dont expect a person working for a particular company who's trying to flog their product assisting you with someone using their competitor's product.
Maybe one day, i wil lbe working for another company using DFSORT. however, thanks all. actually, every one here is very kind, and i like this forum very much..
thanks very much. I have found the solution.. also many thanks to frank..
I think it's not suitable to post the solution here... so sorry for SYNCSORT fans.