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

Author Message
zaphany

New User

Joined: 16 May 2006
Posts: 11

Posted: Mon Jun 12, 2006 3:22 pm    Post subject: Question about DFSORT

Dear all,

Just wondering, i have the following case :

 Code: Input field1   field2   field3 123      456      a 123      000      b 000      789      c

 Code: Output 456a 123b 789c

basically, what i want to do is if field 2 has value, take field 2 & 3 to form the output, if field 2 = 0, take field 1 & 3 to form the output

Now, what i do is to do DFSORT

 Code: sort 1 :    SORT FIELDS=(1,3,CH,A)    INCLUDE COND=(4,3,ZD,EQ,0)    OUTREC FIELDS=(1,3,7,1) sort 2 :    SORT FIELDS=(4,3,CH,A)    INCLUDE COND=(4,3,ZD,NE,0)    OUTREC FIELDS=(4,3,7,1)     sort 3 : merge sort 1 + sort 2 to form the output

My question is: is there a much simplier way to do so? by ICETOOLS or DFSORT?
Thanks!

Frank Yaeger

DFSORT Moderator

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

Posted: Mon Jun 12, 2006 8:31 pm    Post subject:

You can use DFSORT's IFTHEN function to do that kind of thing much more easily. Here's a DFSORT job that will do what you asked for:

 Code: //S1    EXEC  PGM=ICEMAN //SYSOUT    DD  SYSOUT=* //SORTIN DD * 123456a 123000b 000789c /* //SORTOUT DD SYSOUT=* //SYSIN    DD    *   OPTION COPY   INREC IFTHEN=(WHEN=(4,3,ZD,EQ,+0),BUILD=(1,3,7,1)),         IFTHEN=(WHEN=NONE,BUILD=(4,3,7,1)) /*

For complete information on DFSORT's IFTHEN function, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/
zaphany

New User

Joined: 16 May 2006
Posts: 11

 Posted: Tue Jun 13, 2006 1:12 pm    Post subject: Re: Question about DFSORT Thanks Frank! The information really helps! It reduces my original JCLs from 60 lines to 10 lines! so great!!
Frank Yaeger

DFSORT Moderator

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

 Posted: Tue Jun 13, 2006 9:00 pm    Post subject: Glad I could help.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am Need urgent suggestion on DFSORT subratarec DFSORT/ICETOOL 6 Wed Mar 21, 2018 8:46 pm JES2 EXIT 6 QUESTION Randy Horowitz All Other Mainframe Topics 30 Tue Feb 06, 2018 5:47 pm Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am

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