View previous topic :: View next topic
|
Author |
Message |
venkatatcts
New User
Joined: 16 Mar 2009 Posts: 55 Location: India
|
|
|
|
Hi,
I need to extract a column (date = 9999-12-31) from a flat file and need to check one more column value if it is AB then I need to write column 1 ( from 1 to 7 ) and 00 in ( 8 to 9) in syncsort.
I got the value by writing a separate sort to extract to 9999-12-31 and then i did build. How to do that in one single sort.
Thanks,
Venkat |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Post what you have and someone should be able to show how to combine them. |
|
Back to top |
|
|
venkatatcts
New User
Joined: 16 Mar 2009 Posts: 55 Location: India
|
|
|
|
Hi,
first sort
Using INREC ( Date is extracted (9999-12-31) , column1 value = AB )
outrec ( 1,7 and building 00)
second sort
Using inrec (Date is extracted (9999-12-31) , column1 value <> AB)
outrec ( 1,7 and building 01)
Merge the two output file.
How to do this in one sort. I don't have mainframe access |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Post the actual jcl and control statements you used. . . |
|
Back to top |
|
|
venkatatcts
New User
Joined: 16 Mar 2009 Posts: 55 Location: India
|
|
|
|
I cannot copy the jcl as it is remote desktop. Please help |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I suspect you are working in a Windows envirpnment. If you can enter the "stuff" on your 3270 terminal and work with it, you can copy/paste it here. . .
I don't know "remote desktop". . .
If you needed to send this in an e-mail to a co-worker, you would do the same sort of thing. . . |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Here is a sample job that should help you code your sort step. You will obviously need to change the field positions based on your actual data.
Code: |
//STEP1 EXEC PGM=SORT
//SORTIN DD *
AB12345XXXXXXXXXXXX9999-12-31
CD23456XXXXXXXXXXXX2010-12-31
AB34567XXXXXXXXXXXX2010-01-15
EF45678XXXXXXXXXXXX2010-05-01
AB56789XXXXXXXXXXXX9999-12-31
GH67890XXXXXXXXXXXX9999-12-31
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(20,10,CH,EQ,C'9999-12-31')
INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'AB'),BUILD=(1,7,C'00')),
IFTHEN=(WHEN=NONE,BUILD=(1,7,C'01'))
SORT FIELDS=COPY
/* |
Here is the output produced from the above sort step:
Code: |
AB1234500
AB5678900
GH6789001 |
If you have any further questions, please let us know.
Regards, |
|
Back to top |
|
|
venkatatcts
New User
Joined: 16 Mar 2009 Posts: 55 Location: India
|
|
|
|
it works.thanks |
|
Back to top |
|
|
|