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

Syncsort - Incrementing a count value number in the header


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

Moderator


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

PostPosted: Sun Oct 19, 2008 2:59 pm
Reply with quote

Change the below part
Quote:
ZD,ADD,+1,TO=ZD,
as
Quote:
ZD,ADD,+1,TO=ZDF,

Try this and let know if you face any issues.
Back to top
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Sun Oct 19, 2008 3:54 pm
Reply with quote

Oops!! That is working fine!! Thanks a lot !! But still can I do this in SORT instead of using ICETOOL
icon_cry.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Oct 20, 2008 3:56 am
Reply with quote

Hello,

Quote:
They want me to do it using SORT and not ICETOOL. I am not sure why.
I believe your organization needs to make a more consistent decision. . .

Either applications/developers should be permitted to use the "coding" features available in their sort product or they should not. Being permitted to code "anything" that the executable named SORT will do, but not permitted to use xxxMAN or xxxTOOL makes neither logical nor business sense. They are part of the sort product.

If your organization is not willing to support "programming" via the sort product, then it should not be permitted in pgm=sort either. For your management to say that your syntax would be perfectly acceptable if the executable was sort but the same syntax would not be valid if you execute something other than sort is really hard to follow.

The same vendor supports the underlying product code as part of the same product license (afaik).
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Mon Oct 20, 2008 7:45 am
Reply with quote

meltingmemories,

Quote:
But still can I do this in SORT instead of using ICETOOL

Yes, but it may probably need an additional step. But the number of data passes will be more or less the same.

I know it's too late to ask, but after going through your original requirement, I m not clear with this part,

Dont you want to save the incremented value in the counter file itself? Or do you expect some other process to increment it?
Back to top
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Mon Oct 20, 2008 12:14 pm
Reply with quote

Hi,
Yes. I want to store the counter value in a file.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Mon Oct 20, 2008 1:06 pm
Reply with quote

Hello,

Here's a Syncsort job which does the same. It involves 2 steps,

Step-1: Takes the count from counter file-1, increment by one, save it back to the counter file, also creates a Symbol - CNT for the new count.
Step-2: Overlays the symbol - CNT into the header record.
Code:
//STEP1    EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN= Count file ----------------- FB,LRECL=6 
//SORTOUT  DD DSN= Count file ----------------- FB,LRECL=6 
//C1       DD DSN=&&C1,DISP=(,PASS),UNIT=SYSDA             
//SYSIN    DD *                                             
  INREC BUILD=(1,6,ZD,ADD,+1,TO=ZDF,LENGTH=6)               
  SORT FIELDS=COPY                                         
  OUTFIL FNAMES=C1,BUILD=(C'CNT,C''',1,6,C'''',80:X)       
//*                                                         
//STEP2    EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SYMNAMES DD DSN=&&C1,DISP=(OLD,PASS)                     
//SORTIN   DD DSN= Input  file ----------------- FB,LRECL=30
//SORTOUT  DD DSN= Output file ----------------- FB,LRECL=30
//SYSIN    DD *                                             
  INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'BOF'),OVERLAY=(11:CNT))   
  SORT FIELDS=COPY       
Back to top
View user's profile Send private message
meltingmemories

New User


Joined: 13 Oct 2008
Posts: 16
Location: Bangalore

PostPosted: Mon Oct 20, 2008 4:02 pm
Reply with quote

icon_biggrin.gif

Thanks A lot!!! It is woking!! Thanks once again for you support!!!
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top