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
 

 

Is it possible using DFSORT?

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

New User


Joined: 03 May 2005
Posts: 1

PostPosted: Tue May 03, 2005 2:48 pm    Post subject: Is it possible using DFSORT?
Reply with quote

Hi,
I have an input file with the first line as header line and remaining records are data records. I have to sort the data records and the o/p should have the header line followed by the sorted data records. can we do it using DFSORT?
Please advice
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 May 03, 2005 9:03 pm    Post subject:
Reply with quote

You can do this in one pass with DFSORT using DFSORT's new IFTHEN and OVERLAY functions available with z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004). If you don't have the Dec, 2004 PTF installed, ask your System Programmer to install it (it's free). Here's the DFSORT job. I assumed your input file has RECFM=FB and LRECL=80 and I made up some data. But you can change the job appropriately for other attributes and data.

Code:

//S1    EXEC  PGM=ICEMAN
//SORTDIAG DD DUMMY
//SYSOUT    DD  SYSOUT=*
//SYSUDUMP  DD  SYSOUT=*
//SORTIN DD *
THIS IS THE HEADER RECORD
DATA 05
DATA 03
DATA 02
DATA 04
DATA 01
/*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD    *
* Reformat record 1 (header to):
* |record|0|seqnum|
* Reformat record 2-n (data) to:
* |record|1|seqnum|
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'1',82:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(82,8,ZD,EQ,+1),OVERLAY=(81:C'0'))
* Sort on 0 or 1 and then the key.  0 for the header record
* and 1 for the data records keeps the header first.
  SORT FIELDS=(81,1,CH,A,6,2,CH,A)
* Remove 0 or 1 and seqnum.
  OUTREC FIELDS=(1,80)
/*


SORTOUT has:

Code:

THIS IS THE HEADER RECORD
DATA 01
DATA 02
DATA 03
DATA 04
DATA 05


If you need more specific help on this, you need to tell me the RECFM and LRECL of your input file and show me an example of the input records with the relevent fields.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri May 13, 2005 9:29 pm    Post subject: Re: Is it possible using DFSORT?
Reply with quote

Hi Frank,

I tried your code : & got this error in SYSOUT

Code:
ICE805I 1 JOBNAME: ..... , STEPNAME: S020                                   
ICE802I 0 BLOCKSET TECHNIQUE IN CONTROL                                   
ICE104A 0 INVALID INREC OR OUTREC STATEMENT OPERAND         
ICE005A 0 STATEMENT DEFINER ERROR                                             
ICE012A 2 MISSING FIELDS OPERAND DEFINER                                     
ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED                           
ICE000I 1 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 10:52 ON FRI MAY
       INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'1',82:SEQNUM,8,ZD)),
             $                                                             
ICE104A 0 INVALID INREC OR OUTREC STATEMENT OPERAND               
                 IFTHEN=(WHEN=(82,8,ZD,EQ,+1),OVERLAY=(81:C'0'))         
                 $                                                             
ICE005A 0 STATEMENT DEFINER ERROR                                             
           SORT FIELDS=(81,1,CH,A,6,2,CH,A)                                   
           OUTREC FIELDS=(1,80)                                               
ICE012A 2 MISSING FIELDS OPERAND DEFINER                                     
ICE052I 3 END OF DFSORT       


Is this because of version problem of DFSORT I m using.
In above Error I saw it is DFSORT REL 14.0, was that U have written this code for ?

Or there is any other problem,

Thanks & Reagrds,

Priyesh.
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: Fri May 13, 2005 10:34 pm    Post subject:
Reply with quote

Priyesh,

As I said, you need DFSORT R14 PTF UQ95213 (Dec, 2004) to use DFSORT's new IFTHEN function. The error message indicates you don't have that PTF installed. Ask your System Programmer to install the PTF (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri May 13, 2005 10:40 pm    Post subject: Re: Is it possible using DFSORT?
Reply with quote

Thanks Frank,

I hope it didn't bother u to answer such silly queries. icon_lol.gif

Regards,

Priyesh.
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: Fri May 13, 2005 11:43 pm    Post subject:
Reply with quote

Priyesh,

I don't consider such queries "silly". I'm happy to answer questions of any kind on DFSORT and DFSORT's 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 DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am


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