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 find a given number ODD or EVEN?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Kumar Saraboji

New User


Joined: 15 Sep 2009
Posts: 8
Location: India

PostPosted: Tue Sep 22, 2009 7:10 am    Post subject: How to find a given number ODD or EVEN?
Reply with quote

I have the following in input file (LRECL=20,RECFM=FB)

Acct No(1-8) Sequence No(10-12,Format Type=ZD)
AAAAAAAA 001
AAAAAAAB 002
AAAAAAAC 003
AAAAAAAD 004
AAAAAAAE 005

I need an output like below (LRECL=20,RECFM=FB) using DFSORT/ICETOOL

Acct No(1-8) Sequence No(10-12) Type(14-17)
AAAAAAAA 001 ODD
AAAAAAAB 002 EVEN
AAAAAAAC 003 ODD
AAAAAAAD 004 EVEN
AAAAAAAE 005 ODD

I have achieved the above output with the help of FILEAID bach,
(
$$DD01 COPY IF=(12,EQ,B'01'),MOVE=(C'ODD',14)
COPY IF=(12,EQ,B'00'),MOVE=(C'EVEN',14)

)

but not sure how to get it done with DFSORT/ICETOOL. Can any one of you help me out. Many thanks in advance
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Sep 22, 2009 7:34 am    Post subject:
Reply with quote

Hi,

this might assist
Code:
//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
AAAAAAAA 001                                                         
AAAAAAAB 002                                                         
AAAAAAAC 003                                                         
AAAAAAAD 004                                                         
AAAAAAAE 005                                                         
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
   SORT FIELDS=COPY                                                 
     INREC IFTHEN=(WHEN=(12,1,CH,EQ,C'1'),OVERLAY=(14:C'ODD ')),     
           IFTHEN=(WHEN=(12,1,CH,EQ,C'3'),OVERLAY=(14:C'ODD ')),     
           IFTHEN=(WHEN=(12,1,CH,EQ,C'5'),OVERLAY=(14:C'ODD ')),     
           IFTHEN=(WHEN=(12,1,CH,EQ,C'7'),OVERLAY=(14:C'ODD ')),     
           IFTHEN=(WHEN=(12,1,CH,EQ,C'9'),OVERLAY=(14:C'ODD ')),     
           IFTHEN=(WHEN=NONE,OVERLAY=(14:C'EVEN'))                   
/*                                                                   


Gerry
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Sep 22, 2009 7:45 am    Post subject:
Reply with quote

Hi,

or like this
Code:
   SORT FIELDS=COPY                                     
     INREC IFTHEN=(WHEN=(12,1,SS,EQ,C'1,3,5,7,9'),     
                             OVERLAY=(14:C'ODD ')),         
           IFTHEN=(WHEN=NONE,OVERLAY=(14:C'EVEN'))     


Gerry
Back to top
View user's profile Send private message
Kumar Saraboji

New User


Joined: 15 Sep 2009
Posts: 8
Location: India

PostPosted: Tue Sep 22, 2009 7:58 am    Post subject: Reply to: How to find a given number ODD or EVEN?
Reply with quote

Hi Gerry,

Woov.....! Thanks a lot for the solution.

Regards,
Kumar
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: Tue Sep 22, 2009 9:14 pm    Post subject:
Reply with quote

Kumar,

You can use a bit test with DFSORT as you did with FileAid.

Code:

  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=(12,1,BI,EQ,B'.......1'),OVERLAY=(14:C'ODD')),
        IFTHEN=(WHEN=NONE,OVERLAY=(14:C'EVEN'))                     
Back to top
View user's profile Send private message
Kumar Saraboji

New User


Joined: 15 Sep 2009
Posts: 8
Location: India

PostPosted: Wed Sep 23, 2009 10:22 am    Post subject: Reply to: How to find a given number ODD or EVEN?
Reply with quote

Thanks a lot Frank for the solution, from bit wise point of view. It is simply great! replying to the developer of DFSORT/ICETOOL
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm
No new posts Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am


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