IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SYNCSORT help needed


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Thu Mar 03, 2011 8:18 pm
Reply with quote

Hi all,

I am using “SYNCSORT FOR Z/OS 1.3.2.1R” version in my mainframe shop. Please find below query regarding SYNCSORT –

My Input file –
From 1st column to 8th column JOBNAME field is there, from 10th to 17th COST field is there and from 18th to 28th column DATE field is there.


Code:

JOBNAME0 $0.12   05 FEB 2011
JOBNAME1 $0.12   07 FEB 2011
JOBNAME2 $1.38   05 FEB 2011
JOBNAME2 $2.48   07 FEB 2011
JOBNAME0 $1.00   08 FEB 2011
JOBNAME3 $1.55   05 FEB 2011
JOBNAME0 $0.64   06 FEB 2011



For same JOBNAME there may be diffrent entries for diffrent DATEs.

Expected Output file -

Code:

JOBNAME  5-FEB   6-FEB   7-FEB   8-FEB   9-FEB   10-FEB   
JOBNAME0 $0.12   $0.64           $1.00                   
JOBNAME1                 $0.12                           
JOBNAME2 $1.38           $2.48                           
JOBNAME3 $1.55                                                                   


I want all COST for same job should be in same row. For 5th FEB COST should be from column 10th to 17th, for 6th FEB COST should be from 18th to 25th, for 7th FEB COST should be from 26th to 33th column and so on till 18th FEB.

Please let me know whether it will be possible thru SYNCSORT or not? Please let me know if any other clarification required.

Thanks,
Yogeshwar
Back to top
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Thu Mar 03, 2011 8:20 pm
Reply with quote

My apology, I forgot to mention that my both INPUT and OUTPUT files are FB having lenght 200.

Thanks,
Yogeshwar
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Mar 03, 2011 8:25 pm
Reply with quote

SYNCSORT should be posted in the JCL forum

Topic moved.
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Mar 10, 2011 3:27 am
Reply with quote

Here is a SyncSort step that should help you to achieve the desired output. Please note that I have only coded up through Feb 15 (not the 18th). You will need to make the necessary code modifications to accomodate your actual data.
Code:
//SORT1 EXEC PGM=SORT
//SORTIN  DD *
JOBNAME0 $0.12   05 FEB 2011
JOBNAME1 $0.12   07 FEB 2011
JOBNAME2 $1.38   05 FEB 2011
JOBNAME2 $2.48   07 FEB 2011
JOBNAME0 $1.00   08 FEB 2011
JOBNAME3 $1.55   05 FEB 2011
JOBNAME0 $0.64   06 FEB 2011
//SORTOUT DD SYSOUT=*
//SYSOUT  DD SYSOUT=*
//SYSIN   DD *
  INREC IFTHEN=(WHEN=(18,2,CH,EQ,C'05'),BUILD=(1,8,1Z,10:10,5,100Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'06'),BUILD=(1,8,11Z,20:10,5,90Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'07'),BUILD=(1,8,21Z,30:10,5,80Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'08'),BUILD=(1,8,31Z,40:10,5,70Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'09'),BUILD=(1,8,41Z,50:10,5,60Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'10'),BUILD=(1,8,51Z,60:10,5,50Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'11'),BUILD=(1,8,61Z,70:10,5,40Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'12'),BUILD=(1,8,71Z,80:10,5,30Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'13'),BUILD=(1,8,81Z,90:10,5,20Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'14'),BUILD=(1,8,91Z,100:10,5,10Z)),
        IFTHEN=(WHEN=(18,2,CH,EQ,C'15'),BUILD=(1,8,101Z,110:10,5))
  SORT FIELDS=(1,8,CH,A)
  SUM FIELDS=(9,8,BI,17,8,BI,25,8,BI,33,8,BI,41,8,BI,49,8,BI,
      57,8,BI,65,8,BI,73,8,BI,81,8,BI,89,8,BI,97,8,BI,105,8,BI,
      113,2,BI)
  OUTFIL HEADER1=(1:'JOBNAME',10:'5-FEB',20:'6-FEB',30:'7-FEB',
      40:'8-FEB',50:'9-FEB',60:'10-FEB',70:'11-FEB',80:'12-FEB',
      90:'13-FEB',100:'14-FEB',109:'15-FEB')
/*


This is the output generated from the code above:
Code:
JOBNAME  5-FEB     6-FEB     7-FEB     8-FEB     9-FEB     10-FEB    11-FEB    12-FEB    13-FEB    14-FEB   15-FEB
JOBNAME0 $0.12     $0.64               $1.00                                                                     
JOBNAME1                     $0.12                                                                               
JOBNAME2 $1.38               $2.48                                                                               
JOBNAME3 $1.55                                                                                                   
Back to top
View user's profile Send private message
yogeshwar_ade

Active User


Joined: 31 Aug 2006
Posts: 103
Location: INDIA

PostPosted: Thu Mar 10, 2011 5:38 pm
Reply with quote

Thanks Alissa, I will test and get back to you.

Thanks,
Yogeshwar Ade
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts Help needed to assemble IMS sample co... ABENDS & Debugging 4
No new posts RABBIT HOLE NEEDED - "Live"... All Other Mainframe Topics 0
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
Search our Forums:

Back to Top