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



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

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

Postby BillyBoyo » Tue Jul 30, 2013 5:41 am

What does that mean? Please show example input which describes that statement.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

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

Postby rookie1 » Tue Jul 30, 2013 4:59 pm

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.
rookie1
 
Posts: 7
Joined: Fri Jul 19, 2013 5:37 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Tue Jul 30, 2013 7:26 pm

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

Previous

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post