IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

omit record with spaces using sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chitra_chaturvedi

New User


Joined: 24 Jul 2007
Posts: 18
Location: india

PostPosted: Fri Apr 16, 2010 1:45 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Apr 16, 2010 2:00 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 16, 2010 2:06 pm
Reply with quote

are there any records with length less than 10?
Back to top
View user's profile Send private message
chitra_chaturvedi

New User


Joined: 24 Jul 2007
Posts: 18
Location: india

PostPosted: Fri Apr 16, 2010 2:37 pm
Reply with quote

The sort worked fine.
Back to top
View user's profile Send private message
thoulath

New User


Joined: 15 Sep 2010
Posts: 18
Location: chennai

PostPosted: Wed Dec 08, 2010 9:20 am
Reply with quote

Hi.. If I need to omit a whole record of spaces . how can it done?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 08, 2010 10:03 am
Reply with quote

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
View user's profile Send private message
thoulath

New User


Joined: 15 Sep 2010
Posts: 18
Location: chennai

PostPosted: Wed Dec 08, 2010 10:11 am
Reply with quote

It is fixed length. record length is 1900.
Back to top
View user's profile Send private message
Heeraj

New User


Joined: 07 Dec 2010
Posts: 16
Location: Bangalore

PostPosted: Wed Dec 08, 2010 10:55 am
Reply with quote

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
View user's profile Send private message
thoulath

New User


Joined: 15 Sep 2010
Posts: 18
Location: chennai

PostPosted: Wed Dec 08, 2010 11:46 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Dec 08, 2010 4:15 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 08, 2010 4:37 pm
Reply with quote

Also he might need to provide the OPTIONs for handling 'short records'.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Dec 08, 2010 11:18 pm
Reply with quote

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
View user's profile Send private message
thoulath

New User


Joined: 15 Sep 2010
Posts: 18
Location: chennai

PostPosted: Thu Dec 09, 2010 10:07 am
Reply with quote

It has worked fine . thank you gcicchet
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Dec 09, 2010 1:54 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Dec 09, 2010 11:11 pm
Reply with quote

The devil is in the details. icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top