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
 

 

ICETOOL to Syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Oct 12, 2011 10:30 pm    Post subject: ICETOOL to Syncsort
Reply with quote

Add comma at end of all records except the last
A customer asked the following question:
From DFSORT Tricks - OCT 2011

Can DFSORT insert a comma at the end of all of the records except the last one? For example, say I have a
file with the following three records:
Code:
'2008-07-22.00.37.44.297630'
'2008-07-22.00.37.44.297631'
'2008-08-05.00.40.02.167578'

and I want to write an output file like this:
Code:
'2008-07-22.00.37.44.297630',
'2008-07-22.00.37.44.297631',
'2008-08-05.00.40.02.167578'

How can I do that?
You can use the DATASORT operator of DFSORT's ICETOOL to do this quite easily. Here's the job:
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
'2008-07-22.00.37.44.297630'
'2008-07-22.00.37.44.297631'
'2008-08-05.00.40.02.167578'
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) LAST USING(CTL1)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(29:C',')
  SORT FIELDS=(1,1,CH,A)
/*


Can the same be achieved using Syncsort?
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: Wed Oct 12, 2011 10:37 pm    Post subject:
Reply with quote

Hello,

If you have the current release of Syncsort (1.4 or MFX), try it. . .

If there are questions/problems, post a reply including the informational messages generated by the run.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Oct 13, 2011 11:01 am    Post subject:
Reply with quote

Hi Dick,

It is working fine on Syncsort. But I wanted to know how this can be achieved using SORT (Syncsort). Our shop doesn't use ICETOOL.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 988
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Oct 13, 2011 11:50 am    Post subject:
Reply with quote

Quote:
It is working fine on Syncsort. But I wanted to know how this can be achieved using SORT (Syncsort).


huh??

Garry
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Oct 13, 2011 11:54 am    Post subject: Reply to: ICETOOL to Syncsort
Reply with quote

"Can this ICETOOL code from the DFSORT tricks manual work on vanilla SyncSort (no "tool")?"
Back to top
View user's profile Send private message
xknight

Active User


Joined: 22 Jan 2008
Posts: 117
Location: Liberty city

PostPosted: Thu Oct 13, 2011 12:47 pm    Post subject:
Reply with quote

Quote:
It is working fine on Syncsort. But I wanted to know how this can be achieved using SORT (Syncsort). Our shop doesn't use ICETOOL


FYI..
Yes, the job was submitted using the SYNCTOOL. As dick has mentioned version 1.4 & above supports the near DFSORT command, but not all.

In the spool, you can find the relative information on Utility used.

@Bill

Quote:
"Can this ICETOOL code from the DFSORT tricks manual work on vanilla SyncSort (no "tool")?"


Code:
PGM=ICETOOL
needs to be coded, SYNCTOOL will be invoked , performs the operation.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Oct 13, 2011 12:49 pm    Post subject:
Reply with quote

I wanted to know, If this can be converted to PGM=SORT than PGM=ICETOOL.

As in our shop we use only SORT and No ICETOOL
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Oct 13, 2011 1:36 pm    Post subject: Reply to: ICETOOL to Syncsort
Reply with quote

And I was trying to state gylbharat's question as a clarification.

I'll try again. Remember, it is mostly out of interest only.

There is a task in the DFSORT Tricks manual which is performed with ICETOOL.

At a "shop" which has a ban on ICETOOL (may be an Alias)/SYNCTOOL can the same result be achieved just using the plain SORT (SyncSort).

PS. gylbharat, sorry for spelling your name wrong the other day.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Oct 13, 2011 3:46 pm    Post subject:
Reply with quote

Hi,

if you want to use just SORT, this might help

Code:
//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                 
'2008-07-22.00.37.44.297630'                                     
'2008-07-22.00.37.44.297631'                                     
'2008-08-05.00.40.02.167578'                                     
/*                                                               
//SORTOUT  DD DSN=&&OUT,DISP=(,PASS),SPACE=(CYL,(10,10),RLSE)   
//SYSIN    DD *                                                 
  SORT FIELDS=(81,8,BI,D)                                       
  INREC OVERLAY=(29:C',',81:SEQNUM,8,ZD)                         
/*                                                               
//STEP0200 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD DSN=&&OUT,DISP=(OLD,PASS)                         
//SORTOUT  DD DSN=&&SEQ,DISP=(,PASS),SPACE=(TRK,(1))             
//SYSIN    DD *                                                 
  SORT FIELDS=COPY,STOPAFT=1                                     
  OUTREC BUILD=(C' INREC IFTHEN=(WHEN=(81,08,ZD,EQ,+',           
                81,8,C'),',80:X)                                   
/*                                                                 
//STEP0300 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD DSN=&&OUT,DISP=SHR                                   
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  SORT FIELDS=(81,8,BI,A)                                         
/*                                                                 
//         DD DSN=&&SEQ,DISP=SHR                                   
//         DD *                                                   
  OVERLAY=(29:C' '))                                               
  OUTREC BUILD=(1,80)                                             
/*                                                                 



Gerry
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Oct 13, 2011 5:14 pm    Post subject:
Reply with quote

Thanks Gerry...
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Fri Oct 14, 2011 3:39 am    Post subject:
Reply with quote

Hi,

another way of achieving it and it's simpler with no sorting required
Code:
//STEP0001  EXEC PGM=SORT                                               
//SYSOUT    DD SYSOUT=*                                                 
//SORTIN    DD *                                                       
'2008-07-22.00.37.44.297630'                                           
'2008-07-22.00.37.44.297631'                                           
'2008-08-05.00.40.02.167578'                                           
/*                                                                     
//SORTOUT DD DSN=&&S1,DISP=(,PASS),UNIT=SYSDA,SPACE=(TRK,(1,1))         
//SYSIN     DD *                                                       
  SORT FIELDS=COPY                                                     
  OUTFIL REMOVECC,NODETAIL,                                             
  TRAILER1=(C'SEQ#NUM,',X'7D',COUNT=(M11,LENGTH=8),X'7D',80:X)         
/*                                                                     
//STEP0002 EXEC PGM=SORT                                               
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)                                 
//SYMNOUT  DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
'2008-07-22.00.37.44.297630'                                           
'2008-07-22.00.37.44.297631'                                           
'2008-08-05.00.40.02.167578'                                           
/*                                                                     
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  INREC OVERLAY=(81:SEQNUM,8,ZD)                                       
  OUTREC IFOUTLEN=80,                                                   
         IFTHEN=(WHEN=(81,08,CH,NE,SEQ#NUM),                           
         OVERLAY=(29:C','))                                             
/*                                                                     



Gerry
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 syncsort: copy lines after the keyword shreya19 SYNCSORT 1 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


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