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

Syncsort Question


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

New User


Joined: 27 May 2009
Posts: 11
Location: Hyderabad

PostPosted: Tue Dec 29, 2009 11:56 am
Reply with quote

Hi,

I have a file in report format like below

BILLDAY = 'Y'
MONTH = 'DEC'
CYCLE = '10'
MONTHEND = 'Y'
DAY = '1'
YEAR = '09'
CENT = '1'
UNIDT = '20091210'
Y5601 = 'N'

From the above input file I need only CYCLE and UNIDT to write in one output file in one line like first 2 bytes CYCLE and from 3rd byte to 8 bytes are UNIDT .

Can anybody help me to get this done by using sort.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Dec 29, 2009 12:04 pm
Reply with quote

Posting same problem again will NOT help.
www.ibmmainframes.com/viewtopic.php?p=219645&highlight=#219645

need to provide many things like
Input LRECL\RECFM, SORT product being used at your shop.
Sample output etc.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Dec 29, 2009 12:08 pm
Reply with quote

Hi Sambhaji
as soon as the TS will tell the sort product being used I will delete the useless thread
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Dec 29, 2009 12:19 pm
Reply with quote

Thanks Enrico.

Hi Manohar, this is toknow which sort product you are using.
Quote:
If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and should be posted in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in you site.
Code:

//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY
Back to top
View user's profile Send private message
jilumudi_manohar

New User


Joined: 27 May 2009
Posts: 11
Location: Hyderabad

PostPosted: Tue Dec 29, 2009 12:55 pm
Reply with quote

Hi Sambhaji,

We are using SYNCSORT.

SYNCSORT FOR Z/OS 1.3.2.0R

My input file LRECL is 80 and RECFM is FB.

Thanks
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Dec 29, 2009 1:26 pm
Reply with quote

Hi Manohar,
This will give you required fields in output.

Code:

//S1 EXEC PGM=SORT         
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD *           
YDEC10Y109120091210N       
//SORTOUT DD SYSOUT=*     
//SYSIN    DD    *         
  SORT FIELDS=COPY         
  INREC FIELDS=(5,2,12,8) 
/*                         

Output will be
Code:

1020091210
Back to top
View user's profile Send private message
jilumudi_manohar

New User


Joined: 27 May 2009
Posts: 11
Location: Hyderabad

PostPosted: Tue Dec 29, 2009 3:09 pm
Reply with quote

sambhaji...
my input file is like this...

Code:
BILLDAY = 'Y'
MONTH = 'DEC'
CYCLE = '10'
MONTHEND = 'Y'
DAY = '1'
YEAR = '09'
CENT = '1'
UNIDT = '20091210'
Y5601 = 'N'


i need a output with the values of CYCLE and UNIDT, where cycle is = 10 and unidt = 20091210 in above input file....and i need it in single record

Code:
1020091210
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Dec 29, 2009 4:35 pm
Reply with quote

Below is the single step SORT card for the above req
Code:
//*****************************************************
//STEP1    EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                       
BILLDAY = 'Y'                                         
MONTH = 'DEC'                                         
CYCLE = '10'                                           
MONTHEND = 'Y'                                         
DAY = '1'                                             
YEAR = '09'                                           
CENT = '1'                                             
UNIDT = '20091210'                                     
Y5601 = 'N'                                           
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
 INCLUDE COND=(1,5,SS,EQ,C'CYCLE,UNIDT')               
 INREC  IFTHEN=(WHEN=GROUP,BEGIN=(1,5,CH,EQ,C'CYCLE'),
        PUSH=(8:10,2))                                 
 OPTION COPY                                           
 OUTFIL INCLUDE=(1,5,CH,EQ,C'UNIDT'),BUILD=(8,10,80:X)


SORTOUT
Code:
1020091210
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Tue Jan 05, 2010 12:01 am
Reply with quote

Here is the other solution with the older version of syncsort.

Code:

//PS020    EXEC PGM=SYNCSORT
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN1      DD *                                 
BILLDAY = 'Y'                                   
MONTH = 'DEC'                                   
CYCLE = '10'                                     
MONTHEND = 'Y'                                   
DAY = '1'                                       
YEAR = '09'                                     
CENT = '1'                                       
UNIDT = '20091210'                               
Y5601 = 'N'                                     
//CTL1JNF1 DD DSN=AA.T1,         
//             DISP=(,CATLG,DELETE),             
//             UNIT=SYSDA,                       
//             SPACE=(CYL,(1,1),RLSE)           
//CTL1JNF2 DD DSN=AA.T2,         
//             DISP=(,CATLG,DELETE),             
//             UNIT=SYSDA,                       
//             SPACE=(CYL,(1,1),RLSE)           
//CTL1OF01 DD DSN=AA.FINAL,
//             DISP=(,CATLG,DELETE),             
//             UNIT=SYSDA,                       
//             SPACE=(CYL,(1,1),RLSE)           
//TOOLIN   DD *                                 
  SORT FROM(IN1) TO(CTL1JNF1) USING(CTLA)       
  SORT FROM(IN1) TO(CTL1JNF2) USING(CTLB)       
  SORT FROM(CTL1JNF1) USING(CTL1)               
//CTLACNTL DD *                                 
  SORT FIELDS=COPY                               
  INCLUDE COND=(1,5,CH,EQ,C'CYCLE')             
  OUTREC FIELDS=(10,2,SEQNUM,8,ZD)               
//CTLBCNTL DD *                                 
  SORT FIELDS=COPY                               
  INCLUDE COND=(1,5,CH,EQ,C'UNIDT')             
//CTL1CNTL DD *                     
 SORT FIELDS=COPY                   
 JOINKEYS FILES=F1,FIELDS=(3,8,A)   
 JOINKEYS FILES=F2,FIELDS=(9,8,A)   
 REFORMAT FIELDS=(F1:1,2,F2:1,8)   
 OUTFIL FILES=01                   


Code:

output:
1020091210


Thanks
Krishy
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 Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
Search our Forums:

Back to Top