Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

omit record with spaces using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: omit record with spaces using sort
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: 8593
Location: Back in jolly old England

PostPosted: Fri Apr 16, 2010 2:00 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: omit record with spaces using sort
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    Post subject: Reply to: omit record with spaces using sort
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

Site Director


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

PostPosted: Wed Dec 08, 2010 10:03 am    Post subject:
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    Post subject: Reply to: omit record with spaces using sort
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    Post subject: Reply to: omit record with spaces using sort
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    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Dec 08, 2010 4:15 pm    Post subject:
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: 2158
Location: @my desk

PostPosted: Wed Dec 08, 2010 4:37 pm    Post subject:
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 Moderator


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

PostPosted: Wed Dec 08, 2010 11:18 pm    Post subject:
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    Post subject:
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: 2158
Location: @my desk

PostPosted: Thu Dec 09, 2010 1:54 pm    Post subject:
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 Moderator


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

PostPosted: Thu Dec 09, 2010 11:11 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us