View previous topic :: View next topic
|
Author |
Message |
sasikumar1984
Active User
Joined: 02 Jul 2007 Posts: 109 Location: Chennai - India
|
|
|
|
Hi i have the below requirement
Input file :
ABCD 001 M001
ABCD 001 M002
ABCD 002 M001
ABCD 002 M002
EBCD 002 M001
EBCD 002 M003
CBCD 002 M002
My output file should be
Set1 Set2
001 M001
001 M002
002 M001
002 M002
002 M003
That is i want unique entries of variable 2 and variable 3 and reformat the output file only with that data with a header record.
Just by referring some threads here, i just wrote the below code.
SORT FIELDS(6,3,A,10,4,A)
SUM FILEDS=NONE
OUTREC FIELDS=(6,8,1X,1,8)
OUTFIL HEADER1=(1:C'SET-1',5:C'SET-2)
i just wrote this SORTCARD seeing other threads, not yet tested. i can able to test it on Tuesday only. Can anyone help whether my card works or not as per my requirement. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Does your system use Syncsort or DFSORT?
Per your request, the other topic has been deleted. |
|
Back to top |
|
|
sasikumar1984
Active User
Joined: 02 Jul 2007 Posts: 109 Location: Chennai - India
|
|
|
|
Hi Dick,
We use SYNCSORT... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You were close
This:
Code: |
SORT FIELDS(6,3,CH,A,10,4,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1X,6,3,2X,10,4,5X)
OUTFIL HEADER1=(C'SET-1 SET-2') |
gives this:
Code: |
SET-1 SET-2
001 M001
001 M002
002 M001
002 M002
002 M003 |
using Syncsort.
For the SORTOUT, use
Code: |
DCB=(RECFM=FBA,BLKSIZE=0,LRECL=16)
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
sasikumar1984,
Here's another way of achieving the same using SYNCTOOL(untested).
Code: |
//STEP1 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT-*
//IN DD DSN= Input file
//OUT DD DSN= Output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(6,8,CH) FIRST USING(CTL1)
//CTL1CNTL DD *
OUTFIL REMOVECC,HEADER1=(C'Set1 Set2'),BUILD=(6,8) |
|
|
Back to top |
|
|
sasikumar1984
Active User
Joined: 02 Jul 2007 Posts: 109 Location: Chennai - India
|
|
|
|
Arun,
Thanks for ur reply.. as per ur code, i need to have two components to pass the sortcard rite??? i have already one sortcard... i just wanted to change that component alone to achieve the requirement... thanks for ur reply.. i can learn lot seeing ur reply.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Hopefully, you read Arun's post as well as the suggestion/solution before it. . .
From your reply it is not clear that you found it. . .
Are you now ready for Tuesday? |
|
Back to top |
|
|
sasikumar1984
Active User
Joined: 02 Jul 2007 Posts: 109 Location: Chennai - India
|
|
|
|
Hi dick.....
i got solution for my requirement.... of course not yet tested... I just replied to Aruns msg saying, as per his code we need to components to pass the sortcard.. one for TOOLIN and another for CTL1CNTL. but i dont want tat... however i can see different way of achieving the o/p from his reply..
yes i am waiting for Tuesday.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
i got solution for my requirement.... of course not yet tested... |
The result you said you needed has been tested - to repeat:
Quote: |
This:
Code: |
SORT FIELDS(6,3,CH,A,10,4,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1X,6,3,2X,10,4,5X)
OUTFIL HEADER1=(C'SET-1 SET-2') |
gives this:
Code: |
SET-1 SET-2
001 M001
001 M002
002 M001
002 M002
002 M003 |
using Syncsort.
For the SORTOUT, use:
Code: |
DCB=(RECFM=FBA,BLKSIZE=0,LRECL=16) |
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi Dick,
I think he was trying to say that he's yet to run the job with his file. Of course it does n't matter as it's tested OK by you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Arun,
Quote: |
I think he was trying to say that he's yet to run the job with his file. |
Hopefully
What has happened several times in the past is that when multiply replies are posted, one or more seems to "hide" and is missed
Thanks for the followup,
d |
|
Back to top |
|
|
Yugaswaroopini
New User
Joined: 21 Dec 2007 Posts: 10 Location: India
|
|
|
|
Hi All,
Just want to know this.. if the file is opened in the browse mode, we have the following ..
********************************
SET-1 SET-2
001 M001
001 M002
002 M001
002 M002
002 M003
********************************
But if the file is opened in view mode, there is a page break (the 1) as follows
*****************************
1SET-1 SET-2
1 001 M001
001 M002
002 M001
002 M002
002 M003
****************************
My question : Is there a way to get an output file without the page break.? Cos when this file is done FTP, the '1' is also present. There is a requirement in my project to include the header and FTP the file which should not have a pagebreak. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
Is there a way to get an output file without the page break.? |
Yes, Add the REMOVECC parameter to your OUTFIL statement like this.
Code: |
OUTFIL REMOVECC,HEADER1=(C'SET-1 SET-2') |
|
|
Back to top |
|
|
Yugaswaroopini
New User
Joined: 21 Dec 2007 Posts: 10 Location: India
|
|
|
|
Arun,
Thanks a ton javascript:emoticon('')
Smile
Thanks,
YS. |
|
Back to top |
|
|
|