Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Kumar Saraboji

New User

Joined: 15 Sep 2009
Posts: 8
Location: India

 Posted: Tue Sep 22, 2009 7:10 am    Post subject: How to find a given number ODD or EVEN? 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

gcicchet

Senior Member

Joined: 28 Jul 2006
Posts: 1703
Location: Australia

Posted: Tue Sep 22, 2009 7:34 am    Post subject:

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
gcicchet

Senior Member

Joined: 28 Jul 2006
Posts: 1703
Location: Australia

Posted: Tue Sep 22, 2009 7:45 am    Post subject:

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
Kumar Saraboji

New User

Joined: 15 Sep 2009
Posts: 8
Location: India

 Posted: Tue Sep 22, 2009 7:58 am    Post subject: Reply to: How to find a given number ODD or EVEN? Hi Gerry, Woov.....! Thanks a lot for the solution. Regards, Kumar
Frank Yaeger

DFSORT Moderator

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

Posted: Tue Sep 22, 2009 9:14 pm    Post subject:

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'))
Kumar Saraboji

New User

Joined: 15 Sep 2009
Posts: 8
Location: India

 Posted: Wed Sep 23, 2009 10:22 am    Post subject: Reply to: How to find a given number ODD or EVEN? Thanks a lot Frank for the solution, from bit wise point of view. It is simply great! replying to the developer of DFSORT/ICETOOL
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am INVALID RECFM FOR DDNAME SYSLIN AND C... sandeep kumar302 All Other Mainframe Topics 7 Fri Apr 27, 2018 6:07 pm Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us