The field1 i need to extract from input file is coming in 2 - 21 postion.
The field2 i need to extract is coming in 123 - 125 position in my input file.
Currently i am omitting Header and trailer records using Omit condition.
Now I have got one requirement. Depending on the Month present in the header record (56 - 57 position in input file), i have to pick the field2 from input file in different positions.
For EX, if the month is 01, then i have to extract 123 - 125 as field2 from input file
If the month is 02, then i have to extract 126 - 128 as field2 from input file and so on.
The details of the month is present in header record only and it can be identified by it's first position. It starts with '0'.
Could you please let me know how it can be done in DFSORT?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
senjay,
Here is an alternative way of doing it. We create a 1 record symbol statement depending on the the value of the header record and use it to populate the value.
So the output from step0100 will be as follows if it has 01 in pos 56.
Code:
HDRMNTH,123,03
we later use that in the next step to extract the desired field.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Devzee,
The solution I posted is not lengthy. I expanded the solution for complete requirement where as the prior solution considered only first 2 months. This is the actual requirement.
senjay wrote:
For EX, if the month is 01, then i have to extract 123 - 125 as field2 from input file If the month is 02, then i have to extract 126 - 128 as field2 from input file and so on.
Op wanted to pick the fields depending on the value of the month. I expanded the solution for complete 12 months and I am NOT creating the control cards on the fly all the time. I just create 1 symbol to pick the position depending on the month.