View previous topic :: View next topic
Author
Message
shrinivasabharathi_b New User Joined: 04 Nov 2008Posts: 11 Location: Chennai
My File layouts
File 1
----+----1----+----2----+----3----+----4----+----5----+----6----+--
SORT FIELDS=(51,11,CH,A)
INCLUDE COND=(39,4,PD,GE, ,AND,43,4,PD,GT, ,
AND,438,3,CH,EQ,C'146',AND,717,9,CH,NE,C' ')
File 2
----+----1----+----2----+----3----+----4----+----5----+--
1081211 072412
Required output
SORT FIELDS=(51,11,CH,A)
INCLUDE COND=(39,4,PD,GE,1081211 ,AND,43,4,PD,GT,072412 ,
AND,438,3,CH,EQ,C'146',AND,717,9,CH,NE,C' ')
Can this be done using SYNCTOOL?
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
shrinivasabharathi_b
You can do this using a simple SORT-OVERLAY. If the date is in cyymmdd format, you must be having the file-2 date fields like this.( i have added a '0' for date-2)
Code:
----+----1----+----2----+----3----+----4----+----5----+--
1081211 0072412
BTW, how you are generating file-2? is it possible to have 7 digit dates in file-2?
Back to top
shrinivasabharathi_b New User Joined: 04 Nov 2008Posts: 11 Location: Chennai
Sorry , value '1081211' is the only date field and value '072412' is the time field .. and we are getting these values from another file header ..
now the req is to take these values from file 2 and place is it in file 1 dynamic cntl card ..
thanks,
Shrini
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
shrinivasabharathi_b ,
Quote:
we are getting these values from another file header
I would suggest you have the sort card with enough spaces like this
Code:
SORT FIELDS=(51,11,CH,A)
INCLUDE COND=(39,4,PD,GE, ,AND,43,4,PD,GT, ,
AND,438,3,CH,EQ,C'146',AND,717,9,CH,NE,C' ')
and OVERLAY the date and time values to the respective positions while you extract this info from the file.
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
shrinivasabharathi_b,
Another method is to write the DATE and TIME values to a parm dataset as
Code:
DATE-1,+cddmmyy
TIME-1,+hhmmss
and use this as your SYMNAMES dataset in the subsequent job which has a sort card like this.
Code:
SORT FIELDS=(51,11,CH,A)
INCLUDE COND=(39,4,PD,GE,DATE-1,AND,43,4,PD,GT,TIME-1,
AND,438,3,CH,EQ,C'146',AND,717,9,CH,NE,C' ')
Back to top
shrinivasabharathi_b New User Joined: 04 Nov 2008Posts: 11 Location: Chennai
Thank U ..will give a try
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
shrinivasabharathi_b,
Good luck, Reply here if you face any issues.
I just noticed that the date format I mentioned in my previous post is not correct; the correct one would be
Back to top
Please enable JavaScript!