Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SYNCSORT help needed

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT help needed
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    Post subject: Reply to: SYNCSORT help needed
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: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 03, 2011 8:25 pm    Post subject:
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: 500
Location: USA

PostPosted: Thu Mar 10, 2011 3:27 am    Post subject:
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    Post subject: Reply to: SYNCSORT help needed
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us