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
 

 

Syncsort SEQNUM - Start value from a file
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
krishan isharwal

New User


Joined: 25 Aug 2011
Posts: 7
Location: india

PostPosted: Thu Aug 25, 2011 12:53 pm    Post subject: Syncsort SEQNUM - Start value from a file
Reply with quote

I have to use SEQNUM function to create a sequence in my output file. In the start command (START=1 ), i can use 1 (or any other value) to start the sequence. However, i have a requirement that i need this value from another file that is input to my this sort step. I am not sure how to achieve this. I have done this using ICETOOL, however i need to do this by SyncSORT only as ICETOOL is not allowed to be used.

My sort card:
SORT FIELDS=COPY
OUTREC FIELDS=(SEQNUM,8,BI,START=1,9,08)
Back to top
View user's profile Send private message

gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Aug 25, 2011 12:58 pm    Post subject:
Reply with quote

Hi....

Can you please post some sample input and output in code tags
Back to top
View user's profile Send private message
krishan isharwal

New User


Joined: 25 Aug 2011
Posts: 7
Location: india

PostPosted: Thu Aug 25, 2011 2:23 pm    Post subject:
Reply with quote

gylbharat wrote:
Hi....

Can you please post some sample input and output in code tags


Output :
sequence no field other field
1 5
2 6
3 7
4 8
so forth..
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Aug 25, 2011 2:37 pm    Post subject:
Reply with quote

Still not clear on the requirement...

You want the sequence numbers in in columns?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 25, 2011 2:53 pm    Post subject:
Reply with quote

krishan,

If you want to format things for us to read, that is good, but use the Code button to preserve the formatting so we can actually see it.. please?

You have a confusion. SYNCSORT is develped by one company. ICETOOL by another. Many sites seem to "ALIAS" SYNCTOOL to ICETOOL, for whatever reason. It is SYNCTOOL that you are not allowed to use (for reasons unknown), not ICETOOL, which your site almost certainly does not have.

If you have achieved this in SYNCTOOL, please show us the card.

If you have attempted the same solution in SYNCSORT, please show us the card and the output messages/results which show it not working.

All of it Code'd, please.
Back to top
View user's profile Send private message
krishan isharwal

New User


Joined: 25 Aug 2011
Posts: 7
Location: india

PostPosted: Thu Aug 25, 2011 4:21 pm    Post subject: Reply to: SEQNUM - Start value from a file
Reply with quote

SORT FIELDS=COPY
OUTREC FIELDS=(SEQNUM,8,BI,START=1,9,08)

This is the sort card i am using ( for my testing right now ). From position 9 length 8 , i want to copy from my i/p file using 9,08)

From position 1 , i want a sequence no to be generated. The above sort card produces a result.
Code:
              BI 1:8               BI 9:8
<---+----1----+----> <---+----1----+---->
****  Top of data  ****                 
                   1                    5
                   2                    6
                   3                    7
                   4                    8
                   5                    9
                   6                   10
****  End of data  ****                  .

Now, i have harcoded the START=1 i.e it starts the sequence from 1. My requirement is that i need to start from a value which would come from another file. This i have to do using the syncsort
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 25, 2011 4:25 pm    Post subject: Reply to: SEQNUM - Start value from a file
Reply with quote

Where is your SYNCTOOL solution, please?
Back to top
View user's profile Send private message
krishan isharwal

New User


Joined: 25 Aug 2011
Posts: 7
Location: india

PostPosted: Thu Aug 25, 2011 4:41 pm    Post subject: Reply to: SEQNUM - Start value from a file
Reply with quote

I have not tried this using SYNCTOOL. I need to do it using SYNCSORT.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 25, 2011 4:46 pm    Post subject: Re: SEQNUM - Start value from a file
Reply with quote

krishan isharwal wrote:
[...]
I have done this using ICETOOL
[...]


krishan isharwal wrote:

I have not tried this using SYNCTOOL


OK... so show us what you think is your ICETOOL solution that you mention in your first post.
Back to top
View user's profile Send private message
krishan isharwal

New User


Joined: 25 Aug 2011
Posts: 7
Location: india

PostPosted: Thu Aug 25, 2011 5:20 pm    Post subject: Reply to: SEQNUM - Start value from a file
Reply with quote

Code:

//TOOLIN   DD *                                                   
 COPY FROM(COUNTER) TO(TEMPFIL) USING(CTL1)                       
 COPY FROM(INFILE) TO(OUTFILE) USING(CTL2)                       
//*                                                               
//CTL1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=(1,5,CH,EQ,C'ARRID'),                       
        BUILD=(4:C'START=',20,13,ZD,ADD,+1,TO=ZD,LENGTH=13,       
        C',INCR=1))',80:X))                                       
  INCLUDE COND=(1,5,CH,EQ,C'ARRID')                               
/*                                                               
//CTL2CNTL DD *                                                   
  INREC IFTHEN=(WHEN=(1,8,CH,EQ,C' '),                           
  OVERLAY=(1:SEQNUM,8,BI,                                         
/*                                                               
//    DD DSN=*.TEMPFIL,VOL=REF=*.TEMPFIL,                         
//       DISP=(OLD,PASS)
Back to top
View user's profile Send private message
krishan isharwal

New User


Joined: 25 Aug 2011
Posts: 7
Location: india

PostPosted: Thu Aug 25, 2011 5:21 pm    Post subject: Re: Reply to: SEQNUM - Start value from a file
Reply with quote

same functionality i have to do with syncsort
krishan isharwal wrote:
Code:

//TOOLIN   DD *                                                   
 COPY FROM(COUNTER) TO(TEMPFIL) USING(CTL1)                       
 COPY FROM(INFILE) TO(OUTFILE) USING(CTL2)                       
//*                                                               
//CTL1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=(1,5,CH,EQ,C'ARRID'),                       
        BUILD=(4:C'START=',20,13,ZD,ADD,+1,TO=ZD,LENGTH=13,       
        C',INCR=1))',80:X))                                       
  INCLUDE COND=(1,5,CH,EQ,C'ARRID')                               
/*                                                               
//CTL2CNTL DD *                                                   
  INREC IFTHEN=(WHEN=(1,8,CH,EQ,C' '),                           
  OVERLAY=(1:SEQNUM,8,BI,                                         
/*                                                               
//    DD DSN=*.TEMPFIL,VOL=REF=*.TEMPFIL,                         
//       DISP=(OLD,PASS)
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Thu Aug 25, 2011 5:56 pm    Post subject:
Reply with quote

If it is SYNCSORT why did you post in DFSORT? Are you sure it was ICETOOL that you used and not SYNCTOOL - show your messages from that test - if they start WER then it is SYNCTOOL.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Thu Aug 25, 2011 6:27 pm    Post subject:
Reply with quote

krishan isharwal,
Quote:
However, i have a requirement that i need this value from another file that is input to my this sort step.

May be I am not understanding the requirement but if you are trying to generate count based on "another file", what does that file look like? What is the LRECL and RECFM of the input file? I believe your input file will have just one record with the count. Please show content of the input file.

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 25, 2011 8:10 pm    Post subject: Reply to: SEQNUM - Start value from a file
Reply with quote

Frank Yaeger showed a solution the other day, using SYMNAMES and a step to generate the SYMNAME that has the required value (this was a date).

I think that would work as a general approach.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Thu Aug 25, 2011 9:43 pm    Post subject:
Reply with quote

krishan isharwal,

You have already achieved what you want using a SYNCTOOL step. If you are not allowed (or some stupid at your shop is not willing) to implement SYNCTOOL in production, you can very well split your SYNCTOOL step into two Syncsort steps and achieve the same results.
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 Aug 25, 2011 11:35 pm    Post subject:
Reply with quote

Quote:
Many sites seem to "ALIAS" SYNCTOOL to ICETOOL, for whatever reason.


Actually, Syncsort itself ships SYNCTOOL as an alias for ICETOOL.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 26, 2011 3:53 am    Post subject: Reply to: Syncsort SEQNUM - Start value from a file
Reply with quote

Thanks, Frank, I didn't know that. That probably explains the prevalence of it that we see in these fora.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 26, 2011 3:57 am    Post subject: Reply to: Syncsort SEQNUM - Start value from a file
Reply with quote

krishan isharwal,

It would have shortened the process if you had included your SyncTOOL solution from the start, which is a working solution.

As Arun Raj has pointed out, you can do your SyncTOOL solution as a two-step SyncSORT solution.

I prefer the previously-mentioned SYMNAMES solution, as your sort cards are always visibly complete, and you have an element of "self-documentation" from the value being set to a name.

Up to you now.
Back to top
View user's profile Send private message
krishan isharwal

New User


Joined: 25 Aug 2011
Posts: 7
Location: india

PostPosted: Fri Aug 26, 2011 11:18 am    Post subject:
Reply with quote

Arun Raj wrote:
krishan isharwal,

You have already achieved what you want using a SYNCTOOL step. If you are not allowed (or some stupid at your shop is not willing) to implement SYNCTOOL in production, you can very well split your SYNCTOOL step into two Syncsort steps and achieve the same results.


Could you please suggest hor to spilit this into two steps
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2158
Location: @my desk

PostPosted: Fri Aug 26, 2011 8:14 pm    Post subject:
Reply with quote

krishan isharwal,

Splitting your Synctool step into two Syncsort steps would be as shown below.
Code:
//SORT01   EXEC  PGM=SORT                                   
//SYSOUT   DD  SYSOUT=*                                     
//SORTIN   DD  DSN= Counter file                           
//SORTOUT  DD  DSN=&&T1,DISP=(,PASS),                       
//             SPACE=(CYL,(1,5),RLSE)                       
//SYSIN    DD  *                                           
  OPTION COPY                                               
  INCLUDE COND=(1,5,CH,EQ,C'ARRID')                         
  INREC IFTHEN=(WHEN=(1,5,CH,EQ,C'ARRID'),                 
        BUILD=(4:C'START=',20,13,ZD,ADD,+1,TO=ZDF,LENGTH=13,
        C',INCR=1))',80:X))                                 
/*                                                         
//SORT02   EXEC  PGM=SORT                             
//SYSOUT   DD  SYSOUT=*                               
//SORTIN   DD  DSN= Input file                         
//SORTOUT  DD  DSN= Output file                       
//SYSIN    DD *                                       
  OPTION COPY                                         
  INREC IFTHEN=(WHEN=(1,8,CH,EQ,C' '),                 
  OVERLAY=(1:SEQNUM,8,ZD,                             
/*                                                     
//    DD DSN=*.SORT01.SORTOUT,VOL=REF=*.SORT01.SORTOUT,
//       DISP=(OLD,PASS)                               
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
Goto page 1, 2  Next
Page 1 of 2

 

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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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