concatenate strings of two files into another using DFSORT.



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

concatenate strings of two files into another using DFSORT.

Postby nilanjansikdar » Tue Jul 01, 2014 11:00 am

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 :)
nilanjansikdar
 
Posts: 1
Joined: Tue Jul 01, 2014 10:43 am
Has thanked: 0 time
Been thanked: 0 time

Re: concatenate strings of two files into another using DFSO

Postby BillyBoyo » Tue Jul 01, 2014 12:48 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post