Now I want to give following as input based on which sorting will be done-
052415456
052421925
052429561
These values are at a certain position in BH(header record).
Now I want to output that particular BH record along with the PT records associated with it just below it. Number of PT records can vary.
Also need to know how can I give
052415456
052421925
052429561 values as condition to sort. Can it be done through a sysin?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can use a DFSORT job like the following to do what you asked for. You can set up your values as Symbols in a SYMNAMES data set as shown (assuming you have a reasonable maximum number of values, e.g. less than 1500) and use the Symbols in the INCLUDE operand. I assumed your input file has RECFM=FB and LRECL=80 but the job can be changed appropriately for other attributes.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
t5590ag,
Answer the following questions
What is the LRECL and RECFM of the master file.
What is the position and format of the key in the master file
What is the LRECL and RECFM of the lookup key file
What is the position and format of the key in this file?
Joined: 21 May 2009 Posts: 139 Location: United States
master file is FB/400
---+----4----+----5----+----6--
op of Data ********************
000000000 052529991
2653000000000001503600000000000
3000000000001503600000000000
000000000 052529992
2653000000000001503600000000000
3000000000001503600000000000
000000000 052522021
2653000000000001503600000000000
3000000000001503600000000000
000000000 052522022
2653000000000001503600000000000
3000000000001503600000000000
000000000 052484322
6653000000000003756400000000000
3000000000003020000000000000
3000000000000736400000000000
000000000 052484323
6653000000000003756400000000000
key is at position 49-57 in master.
Lookup key file am going to create with these key values taken from somewhere else so as of now it will be FB/9(length of key value).
Pos will be 1-9. Nothing else will be there.[/code]
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
t5590ag,
Since you haven't yet created the lookup file, I suggest you create it as FB 400 so that we can concatenate it to the master file as is with following layout.
Have '$$' in pos 1-2 and the key in pos 49 for 9 bytes and rest spaces
Once you create that dataset , concatenate it with Master file and make sure it is first in the list and use this 1 pass solution which will give you the desired results