Thanks CICS Guy! you are right i will need 12 IFTHEN.
But i am not able to find any example for using IFTHEN in Outrec fields.After checking for the Month i should be able to pick the year, add leading 20, trailing `. this should affect only XLTAGS Records. Can you please provide any sample code? if any?
I was looking for a clue and have achieved 80% of my results. Now one more question..is it possible to suppress some data from the Input file using some parameters along with OUTREC IFTHEN=WHEN? say i wont require data from column 35 - 40 in output file. Whatever may be the data?
Appreciate your response. I am happy to see such quick response, because i used this forum for the first time.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Vikas,
You don't need two passes to do this - a single pass will do. (Krishy seems to have a preference for inefficient code.) Here's a one pass solution for what you asked for. I had to guess at what your input records look like and what you wanted the output records to looke like since it wasn't clear. If you want the output records to look some other way, please show a better example of how you want them to look. If you want to remove some bytes, show an example of the output records for that.
The input record which you guessed in perfect.
XLTAGS|MENDENHALL CONSULTING |0CCV23|0CCV23|05/19/09| ~
XLTAGS|MENDENHALL CONSULTING |0CCV23|0CCV23|03/19/07| ~
Along with this records there are some other detail records like
03/19/07|MENDENHALL CONSULTING |0CCV23|0CCV23|01/19/09|COMMENTS|-123.00| ~.
So my requirment is to remove the Commison Paid column(-123.00) from the Detail records, change the first colomn numeric date to word format(January 07). And change the XLTAGS records only for dates.
so the o/p detail record should look
March 07|MENDENHALL CONSULTING |0CCV23|0CCV23|01/19/09|COMMENTS| ~.
And XLTAGS should look like
XLTAGS|MENDENHALL CONSULTING |0CCV23|0CCV23|May 09| ~
Thanks Frank, Hope above clarifies my requirement.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
What is the RECFM and LRECL of the input file?
Do you only have XLTAGS records and "detail" records, or are there also other types of records in the file?
Can we identify the "detail" records as those records which do NOT start with 'XLTAGS' or is there some other way to identify them?
Are the fields in your records in fixed positions? If so, please give the layout of the fields in each type of record (starting position, length and format of each field).
Or are we talking about delimited fields here?
It would help if you'd give a better example of your input records and expected output records with more variations. And please use code tags for the data.