View previous topic :: View next topic
|
Author |
Message |
nag.kolli
New User
Joined: 20 Apr 2007 Posts: 5 Location: Hyderabad
|
|
|
|
My input file consists of records
abcd1
abcd2
abcd3
abcd4
--------
-------
-------
abcd15
and i need my outputfile only
1
2
3
4
15
so plz suggest me in sort technique
i..e
//sysin dd *
sort records = ( |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
nag,
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1,30,SQZ=(SHIFT=LEFT,
PREBLANK=C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))
/* |
IP LRECL assumed is 30. According to your file LRECL, change in the PREBLANK statement. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Is this an interview question or a class project? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Murali,
That won't work. You have more than the maximum of 10 characters allowed for one PREBLANK string, and you're using uppercase characters instead of lowercase characters.
This DFSORT job will work for the given example:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(1:1,80,SQZ=(SHIFT=LEFT,PREBLANK=C'abcdefghij'),
1:1,80,SQZ=(SHIFT=LEFT,PREBLANK=C'klmnopqrst'),
1:1,80,SQZ=(SHIFT=LEFT,PREBLANK=C'uvwxyz'))
/*
|
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Frank,
Quote: |
That won't work. You have more than the maximum of 10 characters allowed |
Thanks for notifying me. I have not implemented this on MF before post. Taking your sort card in one of the day before yesterday's post, I had posted this.
Once again, Thanks. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
I hope, you already have the best solution by Frank, still for the situation in question, one alternate solution can be used, shown below:
Input:
Code: |
000001 ABCD1
000002 ABCD2
000003 ABCD3
000004 ABCD4
000005 ABCD5
000006 ABCD6
000007 ABCD7
000008 ABCD8 |
Use block command as shwon below
((4
.
.
((
& press enter.
Code: |
((4001 ABCD1
000002 ABCD2
000003 ABCD3
000004 ABCD4
000005 ABCD5
000006 ABCD6
000007 ABCD7
((0008 ABCD8 |
Output:
Code: |
000001 1
000002 2
000003 3
000004 4
000005 5
000006 6
000007 7
000008 8 |
Hope this helps. |
|
Back to top |
|
|
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1,30,SQZ=(SHIFT=LEFT,
PREBLANK=C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))
/*
|
I am getting syntax error for this as below:-
Code: |
********************************* TOP OF DATA **********************************
SYNCSORT FOR Z/OS 1.2.1.1N U.S. PATENTS: 4210961, 5117495 (C) 2005 SYNCSO
z/OS 1.7.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 5B5AE, MODEL 2084 305 LICEN
SYSIN :
SORT FIELDS=COPY
OUTREC BUILD=(1,30,SQZ=(SHIFT=LEFT,
*
PREBLANK=C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'))
WER268A OUTREC STATEMENT : SYNTAX ERROR
******************************** BOTTOM OF DATA ********************************
|
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Quote: |
WER268A OUTREC STATEMENT : SYNTAX ERROR |
You are using SYNCSORT. But the solution provided is in dfsort. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
ajayvamsi,
The solution I provided works fine with DFSORT. But the WER messages indicate you're using Syncsort, not DFSORT. DFSORT has supported the SQZ function since April, 2006 - Syncsort doesn't support it. |
|
Back to top |
|
|
|