MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

JCL to execute DFSORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vkrishna2001
Beginner


Joined: 07 Aug 2003
Posts: 46
Topics: 18
Location: Danbury

PostPosted: Thu Dec 18, 2003 4:13 pm    Post subject: JCL to execute DFSORT Reply with quote

This is the request of one of my friend

The input file record layout

01 I1-REC.
10 WS-SORT-KEY.
15 WS-USER-NUMBER PIC 9(06).
15 WS-PERIOD.
20 WS-CC PIC 9(02).
20 WS-YY PIC 9(02).
20 WS-QQ PIC 9(02).
10 WS-RT-PCT PIC S9(04)V9.
10 WS-OPERATION PIC X(02).
10 WS-REGION PIC X(02).
10 WS-ASM PIC X(02).
10 IND-RT-PCT PIC S9(04)V9.



Sample record in the input file
5218022003030120B8204UD0120B

Output expected

52180220030301202+204UD001202+ (The amount fields with trailing sign)


What is the jcl with DFSORT? At my shop we use SYNCSORT and that JCL won't work as the other shop has DFSORT.

Thanks,
Vijayakrishna
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Dec 18, 2003 4:49 pm    Post subject: Reply with quote

To convert a ZD number like 120B to 1202+ you can use the following in INREC, OUTREC or OUTFIL OUTREC:

Code:

  p,m,ZD,SIGNS=(,,+,-)


This uses the default M0 edit mask but overrides the default of blank for a trailing positive sign to +. Note that SIGNS has two commas before the +,- representing the unneeded leading signs.

What are you using in Syncsort? If you post the Syncsort control statements, I can show you how to use DFSORT to do the same thing.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Thu Dec 18, 2003 4:58 pm    Post subject: Reply with quote

Vijay,

You can use DFSORT's editing Masks to get the desired results.

Code:

//STEP0100  EXEC  PGM=SORT                                         
//SYSOUT    DD SYSOUT=*                                             
//SORTIN    DD *                                                   
5218022003030120B8204UD0120B                                       
//SORTOUT   DD DSN=YOUR OUTPUT FILE,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//SYSIN     DD *                                                   
  SORT FIELDS=COPY                                                   
  INREC FIELDS=(01,06,                                 $ USER-NUMBER
               07,02,                                 $ WS-CC       
               09,02,                                 $ WS-YY       
               11,02,                                 $ WS-QQ       
               13,05,ZD,EDIT=(TTTTTS),SIGNS=(,,+,-),  $ WS-RT-PCT   
               18,02,                                 $ WS-OPERATION
               20,02,                                 $ WS-REGION   
               22,02,                                 $ WS-ASM     
               24,05,ZD,EDIT=(TTTTTS),SIGNS=(,,+,-))  $ IND-RT-PCT 



Hope this helps...

cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Dec 18, 2003 5:31 pm    Post subject: Reply with quote

Vijayakrishna,

We really need to see your Syncsort statements. M0 is equivalent to I...ITS and M1 is equivalent to T...TS. Your data does not have any leading zeros, so it's not clear what needs to be done with leading zeros (keep them or suppress them?).

I'd also like to see the Syncsort statements in order to determine why DFSORT is producing a different result.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vkrishna2001
Beginner


Joined: 07 Aug 2003
Posts: 46
Topics: 18
Location: Danbury

PostPosted: Fri Dec 19, 2003 11:33 am    Post subject: Reply with quote

Kolusu,
Thanks for the control statement. I thought that for DFSORT the control statement and DDNames would be different from those of SYNCSORT. Atleast for this function they are same.

Frank,
My friend was getting error messages which say error in control statement. I closely observed his JCL. The control statements in the instream data are starting from first column which is making them unrecognizable to SORT tool. I asked him to start typing in control statements from second column and submit jcl. It worked.

Frank and Kolusu,

Thanks a lot for the help.


Regards,
Vijayakrishna
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Dec 19, 2003 1:19 pm    Post subject: Reply with quote

Vijayakrishna,

We've tried very hard over the years to recognize the control statements, parameters and DD names the other product uses so as to make migration easier.

The reason control statements must start after column 1 is that you can put a label in column 1 before the "verb", e.g.

Code:

MYSORT SORT FIELDS=(5,4,CH,A)


So anything in column 1 is taken as a label. A blank in column 1 indicates there's no label. Generally, people don't use labels and just start with the verb after one or more blanks.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Dec 19, 2003 1:28 pm    Post subject: Reply with quote

Frank,

While we are on it , I noticed that TOOLIN statements does not have the above mentioned limitation. Sort does not complain even if the statements start from pos '1'. I would like to know as to why TOOLIN statements are exception.

Thanks,

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Dec 19, 2003 2:15 pm    Post subject: Reply with quote

When I "invented" DFSORT's ICETOOL, I decided that labels were not needed for ICETOOL operators since people didn't generally use labels. So I allowed ICETOOL operators to start in column 1. The syntax for ICETOOL and DFSORT are intentionally different. I tried to give ICETOOL a more "modern" look for it's syntax.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group