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
 

 

Selecting Specified Fields

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

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Wed Jun 04, 2008 10:29 am    Post subject: Selecting Specified Fields
Reply with quote

Hi,

We have an input file with 20 Million records. Primary key is combination of Account_ID starting from position 1 to 16 and Record Type from 21-22 postions. Same account number can reside in different record types. In our case we need only 2 record types '01' and '15'.

Our requirement is to read the input file and check for 3 fields (Positions are 108-108, 198-198 and 207-212) from record type '15' and one field from record type '01' (Position 414-414). If any of these fields have valid values i.e., other than spaces, these 2 record types should be written to output file.

NOTE: Record type '01 and '15' have different layouts.

Can we do this using DFSORT?

Here are the details of Input file:

Record length = 1019, Format = VB


Regards,
KSK
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: Wed Jun 04, 2008 1:00 pm    Post subject:
Reply with quote

Code:

INCLUDE COND=(pos,length,format,operator,condition)

example
INCLUDE COND=(1,2,CH,EQ,C'16')
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Wed Jun 04, 2008 5:13 pm    Post subject:
Reply with quote

Please note that above input file is VSAM file.
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: Wed Jun 04, 2008 5:15 pm    Post subject:
Reply with quote

Please note that the above example of code will still work
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 Jun 04, 2008 9:06 pm    Post subject:
Reply with quote

KSK,

If I understand what you want correctly, you can use a DFSORT job like the following to do what you want. I assumed you didn't count the 4-byte RDW in the starting positions you gave, so I added 4 to each starting position:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT   DD SYSOUT=*
//SORTIN DD DSN=...  VSAM input file
//SORTOUT DD DSN=...  output file
//SYSIN   DD   *
   OPTION COPY,VLSCMP
   RECORD TYPE=V
   INCLUDE COND=((25,2,CH,EQ,C'15',AND,
     (112,1,CH,NE,C' ',OR,202,1,CH,NE,C' ',OR,
      211,6,CH,NE,C' '),OR,
    (25,2,CH,EQ,C'01',AND,418,1,CH,NE,C' ')))
/*
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Fri Jun 06, 2008 8:40 am    Post subject:
Reply with quote

Frank,

Thanks very much for your solution. It is working fine.

Expat,

I have tried with your suggested soultion but it was giving some length error as it was a VB file.
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 How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am


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