Page 2 of 2

Re: Insert all records from a file before a line in another

PostPosted: Tue Jul 30, 2013 5:41 am
by BillyBoyo
What does that mean? Please show example input which describes that statement.

Re: Insert all records from a file before a line in another

PostPosted: Tue Jul 30, 2013 4:59 pm
by rookie1
File A

AAAAAAA
BBBBBBBB
XXXXXXXX

File B

CCCCCC
DDDDDD
EEEEEEE


Output

AAAAAAA
BBBBBBBB
CCCCCC
DDDDDD
EEEEEEE
XXXXXXXX


The requirement is I have to insert all records from File B to file A and it has to be inserted before XXXXXX record in file A.
The only known record in File A that can be checked is XXXXXX before which insertion should happen.
I cannot check for any value in File B because it keeps on varying.

Re: Insert all records from a file before a line in another

PostPosted: Tue Jul 30, 2013 7:26 pm
by BillyBoyo
  OPTION COPY
  JOINKEYS F1=INA,FIELDS=(81,1,A),SORTED,NOSEQCK
  JOINKEYS F2=INB,FIELDS=(81,1,A),SORTED,NOSEQCK
  JOIN UNPAIRED,F1,F2,ONLY
  REFORMAT FIELDS=(F1:1,80,F2:1,80),FILL=X'FF'

    INREC IFTHEN=(WHEN=(81,80,CH,EQ,80X'FF'),
                    BUILD=(1,80)),
               IFTHEN=(WHEN=NONE,
                    BUILD=(81,80))



Well, with such little response from you, try this. in place of the SORTIN that you have. However, whether the JNFnCNTL files work with your SyncSort is another thing. You may need three steps.