View previous topic :: View next topic
|
Author |
Message |
chitra_chaturvedi
New User
Joined: 24 Jul 2007 Posts: 18 Location: india
|
|
|
|
Hi,
I need to sort a file to remove records with spaces at a given position(10). The input file is a variable length file of LRECL 80.
Any help is appreciable.
Thanks |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Sort is one of the few products that will consider the RDW as part of a VB file, so you need to add 4 to the 10th byte position, giving a real position of 14 to check for the space.
Code: |
SORT FIELDS=COPY
OMIT COND=(14,1,CH,EQ,C' ') |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
are there any records with length less than 10? |
|
Back to top |
|
|
chitra_chaturvedi
New User
Joined: 24 Jul 2007 Posts: 18 Location: india
|
|
|
|
The sort worked fine. |
|
Back to top |
|
|
thoulath
New User
Joined: 15 Sep 2010 Posts: 18 Location: chennai
|
|
|
|
Hi.. If I need to omit a whole record of spaces . how can it done? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
To get help, you need to provide sufficient info. . .
How long are the records? Is the file fixed or variable length? |
|
Back to top |
|
|
thoulath
New User
Joined: 15 Sep 2010 Posts: 18 Location: chennai
|
|
|
|
It is fixed length. record length is 1900. |
|
Back to top |
|
|
Heeraj
New User
Joined: 07 Dec 2010 Posts: 16 Location: Bangalore
|
|
|
|
Hello,
If I understood your question correctly, you want to omit if all the bytes in a record are spaces. Say if LRECL is 80 all 80 bytes are spaces. You can use the above Sort card itself, but change the starting position(it will be 1 for fixed and 5 for VB) and length will be LRECL.
Please correct me if I am wrong. Thanks.
Heeraj |
|
Back to top |
|
|
thoulath
New User
Joined: 15 Sep 2010 Posts: 18 Location: chennai
|
|
|
|
I tried as u said . Am getting following error
Code: |
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 02:12 ON WE
SORT FIELDS=COPY
OMIT COND=(1,1900,CH,EQ,C' ')
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE221A 0 INVALID FIELD OR CONSTANT IN *OMIT IFTHEN 0 CONDITION 1
ICE751I 0 C5-K51707 C6-K51707 C7-K54603 C8-K51707 E7-K51707
ICE052I 3 END OF DFSORT |
JCL I used is as follows:
Code: |
//S679353S JOB 'TCS',MSGCLASS=X,CLASS=C,NOTIFY=&SYSUID
//UCC11 EXEC UCC11TST
//SPLIT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SORTIN DD DISP=SHR,DSN=BPTN.RTD.S679353.SORT.TEST
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(1,1900,CH,EQ,C' ')
//* |
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
did you look up the error code
Quote: |
ICE221A
ICE221A INVALID FIELD OR CONSTANT FOUND IN [ddname] CONDITION n
Explanation: Critical. An error was detected in the COND parameter of an
INCLUDE or OMIT statement (ddname is blank), or in the INCLUDE or OMIT
parameter of an OUTFIL statement (ddname indicates the first data set in
the OUTFIL group). n indicates the number of the relational condition in
which one of the following errors was detected:
o the length for a field with a format other than SS was greater than
256
o the length for a PD field was 256
o the length for a PD0 field was less than 2 or greater than 8
o the length for a CSF field was greater than 16
o the length for a CSL, CST, ASL, or AST field was 1
o the decimal constant for an FI field was greater than 2 147 483 647 or
. . . . . . . . . . . . . . . . . . . . . . . . . . .
|
You will need to do it with a number of statements
Code: |
SORT FIELDS=COPY
OMIT COND=(0001,0256,CH,EQ,C' ',&,
0257,0256,CH,EQ,C' ',&,
0513,0256,CH,EQ,C' ',&,
0769,0256,CH,EQ,C' ',&,
1025,0256,CH,EQ,C' ',&,
1281,0256,CH,EQ,C' ',&,
1537,0256,CH,EQ,C' ',&,
1793,0108,CH,EQ,C' ')
|
Gerry |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Also he might need to provide the OPTIONs for handling 'short records'. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Also he might need to provide the OPTIONs for handling 'short records'. |
No. He is dealing with FB records here as indicated by:
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
"Short records" are only relevant for VB records. |
|
Back to top |
|
|
thoulath
New User
Joined: 15 Sep 2010 Posts: 18 Location: chennai
|
|
|
|
It has worked fine . thank you gcicchet |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Frank Yaeger wrote: |
No. He is dealing with FB records here as indicated by:
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
"Short records" are only relevant for VB records. |
Oh, My bad.. I did n't notice that the recent post was not from the TS who was in fact working with a VB input file. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The devil is in the details. |
|
Back to top |
|
|
|