IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Selecting Specified Fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ksk

Active User


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

PostPosted: Wed Jun 04, 2008 10:29 am
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: 8797
Location: Welsh Wales

PostPosted: Wed Jun 04, 2008 1:00 pm
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: 355
Location: New York

PostPosted: Wed Jun 04, 2008 5:13 pm
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: 8797
Location: Welsh Wales

PostPosted: Wed Jun 04, 2008 5:15 pm
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 Developer


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

PostPosted: Wed Jun 04, 2008 9:06 pm
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: 355
Location: New York

PostPosted: Fri Jun 06, 2008 8:40 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Selecting the max value from a file. DFSORT/ICETOOL 3
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts Converting unpacked fields to pack us... SYNCSORT 4
No new posts Data for newly added fields not displ... IMS DB/DC 6
Search our Forums:

Back to Top