Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
ksk

Senior Member


Joined: 08 Jun 2006
Posts: 315
Location: Pune, India

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
References
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3725
Location: Brussels once more ...

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

Senior Member


Joined: 08 Jun 2006
Posts: 315
Location: Pune, India

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: 3725
Location: Brussels once more ...

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: 4675
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

Senior Member


Joined: 08 Jun 2006
Posts: 315
Location: Pune, India

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1