View previous topic :: View next topic
|
Author |
Message |
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
i havve a file in which firrst record is header , i need to sort the rest of the dat alone.I dont have icetool , please suggest some other way
eg see the dat below.
THIS IS TEST HEADER
9876
9816
111
2323
290 |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
for your example
Code: |
INCLUDE COND=(1,4,CH,NE,C'THIS') |
or
Code: |
OMIT COND=(1,4,CH,EQ,C'THIS') |
Garry. |
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
Garry , include or exclude will result in the header missing in the output i, want the Header in the output with the data below sorted.
Output has to be like :
THIS IS TEST HEADER
111
290
2323
9816
9876 |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
You can use below...
Code: |
//S1 EXEC PGM=SORT
//SORTIN DD *
THIS IS TEST HEADER
9876
9816
111
2323
290
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'THIS'),OVERLAY=(81:C'1')),
IFTHEN=(WHEN=NONE,OVERLAY=(81:C'2'))
SORT FIELDS=(81,1,CH,A,1,4,CH,A)
OUTREC BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
THNK U |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I dont have icetool |
This statement makes no sense. If you have DFSORT, you do have ICETOOL. ICETOOL has been shipped with DFSORT since 1991!
You can use this DFSORT/ICETOOL job to do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
THIS IS TEST HEADER
9876
9816
111
2323
290
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,4,CH,A)
/*
|
|
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
no Frank, i can use SYNCTOOL but not ICETOOL , i have tried it |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
no Fran, i can use SYNCTOOL but not ICETOOL , i have tried it |
That means you don't have DFSORT but SYNCSORT at your shop |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quote: |
i can use SYNCTOOL but not ICETOOL , i have tried it |
Really? Please post the SYSOUT of the job and the JCL you used-- not sure if you are using DFSORT or SyncSort, your previous topics are mix of both. Usually, at SyncSort sites ICETOOL is alaised to invoke SYNCTOOL. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
cvishu wrote: |
no Frank, i can use SYNCTOOL but not ICETOOL , i have tried it |
As Anuj indicated, SYNCTOOL ships with an alias of ICETOOL. What exactly did you execute and what was the error message that you received? If it was a syntax error, then that most likely indicates that you are running an older release of the product. Support for DATASORT was included in SYNCTOOL 1.6.2, which shipped with SyncSort for z/OS 1.3.2. |
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
COMMAND INPUT ===> SCROLL ===> CSR
********************************* TOP OF DATA **********************************
SYT000I SYNCTOOL RELEASE 1.5.2 - COPYRIGHT 2004 SYNCSORT INC.
SYT001I INITIAL PROCESSING MODE IS "STOP"
SYT002I "TOOLIN" INTERFACE BEING USED
DATASORT FROM(IN) TO(OUT) HEADER USING(CTL1)
SYT048E STATEMENT DOES NOT BEGIN WITH A VALID OPERATOR
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
SYT004I SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 12
******************************** BOTTOM OF DATA ******************************** |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
cvishu,
If you're using SyncSort for z/OS 1.3 or later, I think you can achieve this using the below SyncSort job.
(This is untested as I have an older version here. )
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
THIS IS TEST HEADER
9876
9816
111
2323
290
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'THIS'),OVERLAY=(85:C'1')),
IFTHEN=(WHEN=NONE,BUILD=(81:1,4,JFY=(SHIFT=RIGHT),85:C'2'))
SORT FIELDS=(85,1,CH,A,81,4,CH,A)
OUTREC BUILD=(1,80) |
Sambhaji,
The sort order of the output from your job and the expected output posted by the OP is NOT matching. You need to right justify the values before sorting.
Frank,
I know this is a SyncSort topic. But I am just curious whether the DFSORT's DATASORT will give the required output evenif the input values are left justified? |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Arun,
Based on the OP's SYNCTOOL release, it appears that they are running SyncSort for z/OS 1.2.
The solution you posted will only produce the header message. You need to change your IFTHEN BUILD to an IFTHEN OVERLAY, which would produce the following output:
Code: |
THIS IS TEST HEADER
111
290
2323
9816
9876 |
In regards to the ICETOOL solution using DATASORT, here is the output that would be produced:
Code: |
THIS IS TEST HEADER
111
2323
290
9816
9876 |
So I guess it really depends on what the OP is looking for... |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
cvishu wrote: |
Output has to be like :
THIS IS TEST HEADER
111
290
2323
9816
9876 |
Thanks Alissa for posting the results, We are also running SyncSort for z/OS 1.2. So besides an upgradation to the recent version, would n't it be enough to modify the above card to an IFTHEN OVERLAY to obtain the above expected results ? |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
As long as you keep the JFY statement, yes. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Frank,
I know this is a SyncSort topic. But I am just curious whether the DFSORT's DATASORT will give the required output evenif the input values are left justified? |
If the data is left justified, you can use a DFSORT/ICETOOL job like the following to get the output you want:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
THIS IS TEST HEADER
9876
9816
111
2323
290
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER USING(CTL1)
//CTL1CNTL DD *
INREC OVERLAY=(81:1,4,UFF,TO=ZD,LENGTH=4)
SORT FIELDS=(81,4,ZD,A)
OUTFIL BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Now it's in line with the OPs requirement. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
cvishu,
Here's a SyncSort 1.2 job which should work for your requirement.
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
THIS IS TEST HEADER
9876
9816
111
2323
290
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'THIS'),OVERLAY=(85:C'1')),
IFTHEN=(WHEN=NONE,OVERLAY=(81:1,4,UFF,ZD,LENGTH=4,85:C'2'))
SORT FIELDS=(85,1,CH,A,81,4,ZD,A)
OUTREC BUILD=(1,80)
/* |
|
|
Back to top |
|
|
cvishu
Active User
Joined: 31 Jul 2007 Posts: 136 Location: india
|
|
|
|
thnks people |
|
Back to top |
|
|
|