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
 

 

Questions On Sort

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

New User


Joined: 16 Mar 2008
Posts: 90
Location: tamil nadu

PostPosted: Wed Jan 06, 2010 9:28 pm    Post subject: Questions On Sort
Reply with quote

1)we have a master file and sold file .
At the end of the day if a product B has 100 in master file and if it has 10 Product B sold out in the sold file .then if a run a JCL program the master file must Have 90 in it . similarly we have other products like A,C

Code:

Master File 
A 100       
B 100       
C 200       

Sold  File
A 10     
A 20     
B 10     
A 30     
B 20     
C 15     


Can anyone help in the logic how it can done using simple sort or DF sort.

L.Nethaji
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: Wed Jan 06, 2010 11:37 pm    Post subject:
Reply with quote

What is the RECFM and LRECL of the Sold File and Master File?

What is the starting position, length and format of each field in each file?

Please show what you expect the output file to look like for your input example. Please use ubb code tags around your examples.
Back to top
View user's profile Send private message
l.nethaji

New User


Joined: 16 Mar 2008
Posts: 90
Location: tamil nadu

PostPosted: Thu Jan 07, 2010 8:32 am    Post subject: RECFM is Fixed and LRECL 80-
Reply with quote

Hi,

The Format for both is fixed and record length 80.
Product NAme is declared as x(1) and the product count is declared as 9(4) on both the master and sold file.I just want the logic.If u have any similar examples for suming the values based on the fields please send me the JCL.

Thanks for the reply,
L.Nethaji
Back to top
View user's profile Send private message
l.nethaji

New User


Joined: 16 Mar 2008
Posts: 90
Location: tamil nadu

PostPosted: Thu Jan 07, 2010 8:36 am    Post subject: REgarding the Key position
Reply with quote

Hi,

I missed the position in the last reply.

In master file

1st position is the product name declared as x(1). .
next 4 postion is the product count 9(4).
next 75 is the product description declared x(75)

In sold file

1st position is the product name declared as x(1) .
next 4 postion is the product count .as 9(4).
next 75 is the product description declared x(75).

Thanks,
L.Nethaji
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jan 07, 2010 9:32 pm    Post subject:
Reply with quote

Hello,

Quote:
Please show what you expect the output file to look like for your input example. Please use ubb code tags around your examples
Now, you need to provide this. . .

Showing the data. . .
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: Thu Jan 07, 2010 11:22 pm    Post subject:
Reply with quote

Nethaji,

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD *
A0100
B0100
C0200
//IN2 DD *
A0010
A0020
B0010
A0030
B0020
C0015
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1)
COPY FROM(IN2) TO(T1) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(2:2,4,ZD,MUL,-1,TO=ZD,LENGTH=4)
/*
//CTL2CNTL DD *
  OPTION ZDPRINT
  SORT FIELDS=(1,1,CH,A)
  SUM FIELDS=(2,4,ZD)
/*


OUT would have:

Code:

A0040   
B0070   
C0185   
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 Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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