Page 1 of 1

concatenate strings of two files into another using DFSORT.

PostPosted: Tue Jul 01, 2014 11:00 am
by nilanjansikdar
Hi guys,
I need to concatenate a field of a file into some of the records of another file.
File 1 will have only one record. File 2 can have multiple record. LRECL for both the files are 80
Please see the below scenario:

File 1 :
AAA BBB CCC

File 2:
*ABCDEFGHI

*DFSORT example
XXX YYY ZZZ


here in 2nd file if the record is comment (*) or an empty record (spaces) then need to keep as it is in output file but if it is not then need to apend with the string of file 1 (say AAA). Below is the sample output
Output file:
*ABCDEFGHI

*DFSORT DFSORT
XXX YYY ZZZ AAA

Need your help
Thanks :)

Re: concatenate strings of two files into another using DFSO

PostPosted: Tue Jul 01, 2014 12:48 pm
by BillyBoyo
In one very small step, from your single-record file, generate a symbol on a SYMNAMES-format file (FB 80).

In your second step, a COPY operation, include the SYMNAMES file generated above (and SYMNOUT to sysout so you can see it), and "append" the symbol (which will append the value of that constant). There are examples here, I think.