1)Each record has one field of variable length in a flat file of length 10.
aaa
bbbbb
ccccccc
I want each record to be suffixed with ,(comma) at the end of non blank chars in the record.
i.e.
o/p should be:::
aaa,
bbbbb,
ccccccc,
I had tried with PARSE but no use as it uses FIXLENGTH. Whenever PARSE finds blank, i moved it to FIXLENGTH of 7 and used BUILD to append comma.i could see few spacess before comma.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Can you have embedded spaces in your data?
If not, FINDREP (which finds and replaces) can do it for you. Change a space to a comma, and DO it only once.
Edit: This looks related to your previous question. If so, it is probably best to list the whole requirement, otherwise we might spend time on things we later find aren't necessary.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
OK, no problem.
Remember, if connected to your previous question and one of the every-third input records contains eight characters, the trailing comma will be chopped off when it becomes one of three parts of a 28-byte record.
I'd done on for the "embedded spaces", so it may as well appear...
I want to do a specific processing for the last record in an input file and i dont know how many records are in the input file and i cant uniquely identify the last record.
For the same sample jcl you have given above ,
For example if i want to append semicolon (;) to the last record alone in an input file.How can it be done?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
sudhanaveenkumar wrote:
Thanks Kolusu.
I have one more question.
I want to do a specific processing for the last record in an input file and i dont know how many records are in the input file and i cant uniquely identify the last record.
For the same sample jcl you have given above ,
For example if i want to append semicolon (;) to the last record alone in an input file.How can it be done?
Thanks a lot
Use the following DFSORT/ICETOOL JCL which will give you the desired results