Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
Will any of the sorted records have the 1,1,BI EQ X'00' or X'FF'? Do they represent headers and/or trailers?
If these are trailers, are there only one each or are there many creating groups of header/trailered detail records?
I would think IFTHEN ON statements could build the unique sortfields and append the original data onto the common length key and produce the output in a single pass.....
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
vinodkrs,
It's not clear what you're trying to do. I don't have time to try to figure out what you want from all of those operators and control statements.
Your TO ddname is OUT1 for all of the operators. Is OUT1 a MOD data set that will contain the different versions of the input file you're creating? Or are you just showing what you'd like to get in one output data set?
You really need to step back and explain what you're trying to do. Show a good example of your input records (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of the relevant fields.
Parm 2 and 3 contains header and trailer respectively. I have to include the same header and trailer as my input file to the output file. OUT1 is the DD name for my output file. It will contain the following
header(CPY1)
records sorted based on SRT1(parm4)
records sorted based on SRT2(parm5)
records sorted based on SRT3(parm6)
records sorted based on SRT4(parm7)
records sorted based on SRT5(parm8)
trailer(CPY2)
Now i am getting the perfect result, but i want to reduce the number of parms. Is there any way to reduce the number of parms?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Vinodkrs,
I think we can club all those control cards into 1 single pass. In order to help you with a single pass solution I need the following details.
1. What is the LRECL and RECFM of the input dataset
2. Show me an example of the UFF fields on each record type. ie. type 01 & 02 has 7 bytes of uff data and type 03 has 5 bytes of uff data and type 04 has 4 bytes of uff data. What do the values for these fields look like?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
vinodkrs,
The uff fields you show have sign in them and you dont consider the sign when sorting? If that is what you want then here is a DFSORT JCL will give you the desired results. The basic idea is to add all the sort fields for all conditions at the end of every record with record identifier using IFTHEN and then sort them as a single field and later on remove that extra bytes using OUTREC.