Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us