Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To extract records with specific byte count

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

Active User


Joined: 02 Oct 2008
Posts: 151
Location: India

PostPosted: Wed May 05, 2010 8:33 pm    Post subject: To extract records with specific byte count
Reply with quote

My requirement is as follows:
Need to extract only 17 byte alpha-numeric data (without spaces) which comes in pos 1-30.
In the below example, we are extracting only 1st and 6th record because only those 2 records have exact 17 bytes alpha-numeric without spaces in between them.

Input
Code:
1B7HC16Y9X3333339           
2001 PONTIAC FIREBIRD       
2G2GGIK81333666   
4Y756JUKOD6767666653666   
1990 BENZ CORVETTE     
1C7HBAS805L510444
1975 INTERNATIONAL MODEL 1111
8VRTT 43333666789

Output
Code:
1B7HC16Y9X3333339           
1C7HBAS805L510444     


The above record comes in Fixed Byte file of LRECL 100.

Thanks
Vinu
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 05, 2010 9:17 pm    Post subject:
Reply with quote

Vinu78,

Use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD DSN=Your input fb 100 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                   
  OMIT COND=(1,17,SS,EQ,C' ',OR,18,13,CH,GT,C' ') 
  SORT FIELDS=COPY                                 
//*
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed May 05, 2010 10:03 pm    Post subject:
Reply with quote

Hi Kolusu... This was very smart.. I liked it.. You are great.. icon_smile.gif
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 151
Location: India

PostPosted: Wed May 05, 2010 10:30 pm    Post subject:
Reply with quote

Thanks so much Kolusu. That was a great logic. It worked fine.

Could you please guide me what exactly will 18,13,CH,GT,C' ' does.
I ran it and got the desired results but was not able to get what it does.
Will it look for any character greater than SPACES and omit it.
Whether GT C' ' means valid charcters and numbers ?

Thanks
Vinu
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed May 05, 2010 10:33 pm    Post subject:
Reply with quote

What about a blank in 1 with no blanks after, shouldn't that pass also?
Code:
000000000111111111122222222223
123456789012345678901234567890
 8768B7HC16Y9X3333334564568824
Back to top
View user's profile Send private message
vinu78

Active User


Joined: 02 Oct 2008
Posts: 151
Location: India

PostPosted: Wed May 05, 2010 10:35 pm    Post subject:
Reply with quote

Yes Craig. That issue can come.. Till now my input doesn't have that scenario. however as you told, that scnenario can come (may be 17 byte alpha-numeric can start from 2nd or 3rd or 4th byte so on till 13th byte)
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 05, 2010 10:50 pm    Post subject:
Reply with quote

vinu78 wrote:
Thanks so much Kolusu. That was a great logic. It worked fine.

Could you please guide me what exactly will 18,13,CH,GT,C' ' does.
I ran it and got the desired results but was not able to get what it does.
Will it look for any character greater than SPACES and omit it.
Whether GT C' ' means valid charcters and numbers ?

Thanks
Vinu


Yes it will check 13 bytes from position 18 and if it find any hex value greater than space(x'40') it will be eliminated . However if your input has binary zeroes (x'00') in any of the 13 bytes then the condition will fail because x'00' is < x'40'
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 column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us