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 in DFsort

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

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Wed Jul 13, 2005 4:05 pm    Post subject: Is it possible in DFsort
Reply with quote

Hello one and all,

Iam having an requirement as follows

I have a plan code and a sscode lets say plan is 540 and sscode varies from S1 thru S4 like this for each plan there are only 4 sscode that
is S1 thru S4. Plan are 24. So I must split the input file into 96 files for each plan and sscode.

Now before writing any record into these files I should wirte a header record consisting of following fields Plan code, sscode,sum of records of that particula combination), total number of four sscode for that plan. I hope you got it

Now my requirement here is to first count the number of record for a plan and its related sscode. in next step I should count total records for a plan with all sscodes added.

For Eg

Lets say for a plan 540 and sscode S1 i have 100 records Similarly for the same plan and S2 I have 200 record and for same plan and S3 I have 150 recs and for same plan and S4 I have 200 recs

fist thing I should count how many records are there for under S1+540 and so forth for all 4 combinations then again combine all 4 counts and again count total number of records. Then finally update the files.

I hope you got my requirement

Pls let me know if you can find a solution for this using Sort. for inital counts atleast. Then I will go for a cobol program for updating the records.

Thanks and Regards
Tanden
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 Jul 13, 2005 9:33 pm    Post subject:
Reply with quote

Please show sample input and output with relevent fields and indicate the position, length and format of the relevent fields. Also, what is the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Thu Jul 14, 2005 7:43 pm    Post subject:
Reply with quote

Dear Frank,

Thanks for Responding. Please find the details as below:

my input file has
position 1, length 3, - plan code
position 4, length 2 - sscode
LRECL is 1000
There were about 2000 recs

Input file
900S1.....0001000.....
900S1....3431000...
900S2....0000000...
900S3....000000...
900S4....000000...
900S4....000000...
901S1....00000....
901S2....00000
902S3....00000

OUTPUT FILE should contain the following
The fields are:
Plan code, sscode, number of recs per sscode in the plan, total number of recs(s1+s2+s3+s4 per plan)
900, S1, 2, 6
900, S2, 1, 6
900, S3, 1, 6
900, S4, 2, 6

901, S1, 1, 2
901, S2, 1, 2

902, S3, 1, 1

Hope I am clear.

Thanks and Regards
Tanden
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 Jul 14, 2005 9:23 pm    Post subject:
Reply with quote

Tanden,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/1000)
//*** Use MOD for T1
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/1000)
//TOOLIN DD *
* IN->T1:  Get plan count records as follows:
* pln        pc
 COPY FROM(IN) USING(CTL1)
* IN->T1:  Get sscode count records as follows:
* pln, ss,sc,
 COPY FROM(IN) USING(CTL2)
* SPLICE plan count records with sscode count records to get:
* pln, ss,sc,pc
 SPLICE FROM(T1) TO(OUT) ON(1,3,CH) WITHALL WITH(1,11)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    SECTIONS=(1,3,TRAILER3=(1,3,12:COUNT=(M10,LENGTH=2)))
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    SECTIONS=(1,5,TRAILER3=(1,3,C', ',4,2,C',',
      9:COUNT=(M10,LENGTH=2),C',',13:X))
/*


OUT will have:

Code:

900, S1, 2, 6   
900, S2, 1, 6   
900, S3, 1, 6   
900, S4, 2, 6   
901, S1, 1, 2   
901, S2, 1, 2   
902, S3, 1, 1   
Back to top
View user's profile Send private message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Fri Jul 15, 2005 2:28 pm    Post subject:
Reply with quote

Thank you verymuch for the answer Frank.

It is of much help.

Regards
Tanden.
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 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
No new posts Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm


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