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
 

 

Compare the length of a data

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Thu Jan 27, 2011 2:35 pm    Post subject: Compare the length of a data
Reply with quote

I have following record :
Code:

100 RECORD1
200 RECD2
300 RECORD3
400 RECD4
500 RECORD5


here, 100 is field-1(starting at position 1 and length is 3) and RECORD1 is fieled-2(starting at position 5 and length is 10)
All I want to do is to select only those records whose second fields data length is greater than 5.

in my example , i am intrested in records :
Code:

100 RECORD1
300 RECORD3
500 RECORD5


How do I write the DFSORT control statement to get this done ?

Any help is highly appreciated.

Thanks.
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: Thu Jan 27, 2011 2:39 pm    Post subject:
Reply with quote

Hello,

One way to do what you want is to INCLUDE only records that are non-blank in the last 5 positions (or OMIT those that are blank).
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Thu Jan 27, 2011 2:42 pm    Post subject:
Reply with quote

@dick


Thanks for the quick response.
Is there any length function that could serve the purpose.
I have researched on this but couldnt find any results.

Thanks a lot.
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: Thu Jan 27, 2011 2:46 pm    Post subject:
Reply with quote

Hello,

Specify the length (which for your question is 5) in the include or omit statement. . . It is part of the required syntax.
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: Fri Jan 28, 2011 12:21 am    Post subject:
Reply with quote

There is no "find the length of the characters up to the first blank" function.

But there are other ways to do what you want.
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Fri Jan 28, 2011 9:50 am    Post subject:
Reply with quote

Hi Frank,

Could you please tell me what are the other ways to do this.

Thanks
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: Fri Jan 28, 2011 10:23 am    Post subject:
Reply with quote

Hello,

If the posted "requirement" and the suggested solution do not do what you want, you need to post the "real" requirement (i.e. What are you really trying to accomplish?).

Suggest you post some "real" sample input and the output you want from that sample input. Post the rules for getting from the input to the output. Mention the recfm and lrecl of the files.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Jan 28, 2011 1:24 pm    Post subject:
Reply with quote

Quote:
100 is field-1(starting at position 1 and length is 3) and RECORD1 is fieled-2(starting at position 5 and length is 10)
All I want to do is to select only those records whose second fields data length is greater than 5.


By your definition, all the second fields have a length of 10. They may be padded with blanks or nulls, but they still have a length of 10.

Any chance you might be dealing with a VB rather than FB file?

Garry.
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: Sat Jan 29, 2011 1:01 am    Post subject:
Reply with quote

Quote:
Could you please tell me what are the other ways to do this.


Assuming your input has RECFM=FB and you want to keep the records that have a non-blank in positions 1-6 (> 5 non-blank characters), you can use these DFSORT control statements:

Code:

   OPTION COPY
   OMIT COND=(5,6,SS,EQ,C' ') 


So if your input records were:

Code:

100 RECORD1           
200 RECD2             
300 RECORD3           
400 RECD4             
500 RECORD5           
601 A                 
602 AB                 
603 ABC               
604 ABCD               
605 ABCDE             
606 ABCDEF             
607 ABCDEFG           
608 ABCDEFGH           
609 ABCDEFGHI         
610 ABCDEFGHIJ         


Your output records would be:

Code:

100 RECORD1         
300 RECORD3         
500 RECORD5         
606 ABCDEF           
607 ABCDEFG         
608 ABCDEFGH         
609 ABCDEFGHI       
610 ABCDEFGHIJ       


If that's NOT what you want, then you need to do a better job of explaining what you do want with better examples of input and expected output.
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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