properly formatting Your questions and the sample data will help people willing to help
Quote:
Please help me with the solution.
Not until You will be able to describe the process in clear words
just <dumping> a sample of the input and of the output will not help You to get an answer
ok for the "1" identifying the header, but what criteria must be used for the other records
the sample posted just rearranges them in some <illogical> way
Requirements are not clear. Please provide us all the rules followed in order to attain your output. Until unless you give us a clear picture we cannot help you much.
As per requirement, the input file have 6 kind of records. 1 st clumn of every record is the record type. rectype=1 is header record. record type 2,3,5,7,8 are a set of record in which 2 and 5 have single occurance in a set and 3,7,8 have either single/multipleoccurarances for a set or may not be present at all.
Input file eg.:
I want to write a DFSORT where i can get record 2 and 5 in an alternative order of record types: first record types 2 and 5, followed by the other types.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Having had your first post Coded, why didn't you do the second one yourself?
Are these "groups" of records delimited by the header=1, or is this an entire file?
You want 1, 2, 5, which must exist, in that order, followed by 3, 7, 8, which may be multiple, or may not even exist in numeric order within this second grouping?
You got any recfm/lrecl for your input and output.
See if you can work out from "stickies" in DFSORT forum how to tell your level of DFSORT.
Process is resonably simple. If 1 2 5, set generated field to a value, else set it to a different value. Sort on that value, then on record type. This is in English, the wizards will have ways to implement.
If this is not an entire file, would need another "key" for the sorting, and would need to know if header is for file or for key.
Are you trying to say that:
1: File will have one record with record type 1
2:Followed by chunk of record types 2 then 3(optional) then 5 then 7 (optional) then 8(optional)
And your are trying to sort records like record type 1(file level) then record type 2 then 5 then optional record types if present like 3,7,8
Confirm if my assumption is correct...
Also please provide:
What is LRECL\RECFM of input file
Please clarify -
1. Always record type 1 will be the first record
2. Second record will be type 2 and the set continues till the next occurance of type 2 record.
3. You want to sort the records between the type2 records? In which you want to follow the order 2,5 and other records in ascending order.
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
Ruma Dutta,
ask your school instructor for the answer.
we actually have things to do,
and needlessly wasting time pulling info from you to define your requirements
is not something,
even on a Friday,
that we want to do.
Your assumption is correct.
1. Always record type 1 will be the first record
2. Second record will be type 2 and the set continues till the next occurance of type 2 record.
3.I want to sort the records between the type2 records? In which you want to follow the order 2,5 and other records in ascending order.
I think these will clarify other people doubts too. Thank you
Your assumption is correct.
1. Always record type 1 will be the first record
2. Second record will be type 2 and the set continues till the next occurance of type 2 record.
3.I want to sort the records between the type2 records? In which you want to follow the order 2,5 and other records in ascending order.
I think these will clarify other people doubts too. Thank you
You still havn't told LRECL and RECFM of input file and output file yet
THINKSRINIII
Didnt check if your solution actually works but few quick point I could observe..
1:WHEN=(1,1,CH,NE,C'5',OR,1,1,CH,NE,C'2'),
This is weird
2: Also Why you have added sequence number? Doesn't look you have used anywhere...