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
 

 

How to check COMP-3 variable thru sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to check COMP-3 variable thru sort
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    Post subject:
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 Moderator


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

PostPosted: Thu Dec 13, 2007 10:56 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


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