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

How to check COMP-3 variable thru sort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahul.banik

New User


Joined: 23 Jan 2007
Posts: 16
Location: Mysore

PostPosted: Thu Dec 13, 2007 6:43 pm
Reply with quote

Hi All,

This is the FILE AID view of a particular field of my input file.

Code:

EZT0A-05-OPEN-DATE
5/PS               
(528-531)         
155----------------
*******************
             800502
             950315
             800802
             800802
            1051116
             801202
             821102
             810202
             810202
             810302
             810302
             950809
             980115
             750502
             851002
            1020611
            1070222
*******************

This EZT0A-05-OPEN-DATE field is a S9(07) COMP-3 variable and the date format is like CYYMMDD where C represent the century.For 19th C=0 and for 20th C=1.

My requirement is to fetch all the records with DD=02 using SORT.

Thanks,
Rahul
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Thu Dec 13, 2007 7:24 pm
Reply with quote

rahul.banik,
Quote:
EZT0A-05-OPEN-DATE field is a S9(07) COMP-3 variable and the date format is like CYYMMDD where C represent the century.For 19th C=0 and for 20th C=1.

My requirement is to fetch all the records with DD=02 using SORT.

S9(07) COMP-3 will occupy 4 bytes. Let us assume these 4 bytes are in position 1 and length 4. The following DFSORT statements will retrieve the records of DD=02.
Code:
  OPTION COPY
  INCLUDE COND=(3,2,BI,EQ,B'....00000010....')
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: Thu Dec 13, 2007 10:56 pm
Reply with quote

Quote:
(528-531)


Rahul,

Assuming this means that your 4-byte PD field is in positions 528-530, here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(530,2,PD0,EQ,X'02')
/*
Back to top
View user's profile Send private message
rahul.banik

New User


Joined: 23 Jan 2007
Posts: 16
Location: Mysore

PostPosted: Fri Dec 14, 2007 5:42 pm
Reply with quote

Hi Frank,

Thank you.It is working fine.

Thanks,
Rahul
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top