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

Syncsort - Increment Nbrs for different weekdays


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

New User


Joined: 30 Jan 2008
Posts: 26
Location: Chennai

PostPosted: Wed Dec 22, 2010 11:37 pm
Reply with quote

Hi All,

I have a file (the file length is 80 bytes FB) with the following layout

XXXXXXYYYYYY
(Where XXXXXX and YYYYYY are 2 different fields PIC 9(6))

I have to increment the first field everyday and the 2nd field has to be incremented only from Sunday thru Monday. The 2nd field should not be incremented on Saturday.

Also when the numbers (in the field) reaches the maximam value '999999' it should get reset to 000001.

Is it possible to achieve this thru a SORT card.

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

New User


Joined: 30 Jan 2008
Posts: 26
Location: Chennai

PostPosted: Wed Dec 22, 2010 11:49 pm
Reply with quote

Also am using SYNCSORT FOR Z/OS 1.3.2.1R
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Dec 23, 2010 2:18 am
Reply with quote

A tiny little REXX would work in a second or two.

I know, the requirement says JCL.

Shouldn't it be all about the solution?
Back to top
View user's profile Send private message
DKartiya

New User


Joined: 30 Jan 2008
Posts: 26
Location: Chennai

PostPosted: Thu Dec 23, 2010 3:36 am
Reply with quote

Yeap. REXX should also be fine. Though would be good to have it in SYNCSORT.

Would appreciate any help !!
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Dec 23, 2010 12:28 pm
Reply with quote

DKartiya,

The below Syncsort job would work for your requirement. I have assumed the starting positions to be 1 and 8.
You may need to modify it appropriately.
Code:
//STEP01A  EXEC PGM=SORT     
//SYMNAMES DD  *             
DAY,S'&LWDAY'               
//SORTIN   DD  *             
000006 000010               
000007 000011               
000008 999999               
000009 000013               
999999 000014               
000001 999998               
//SYSOUT   DD  SYSOUT=*     
//SORTOUT  DD  SYSOUT=*                                   
//SYSIN    DD  *                                         
  OPTION COPY                                             
  INREC IFTHEN=(WHEN=INIT,                               
       OVERLAY=(1:1,6,ZD,ADD,+1,M11,LENGTH=6,81:DAY)),   
        IFTHEN=(WHEN=(81,3,CH,NE,C'SAT'),                 
       OVERLAY=(8:8,6,ZD,ADD,+1,M11,LENGTH=6),HIT=NEXT), 
        IFTHEN=(WHEN=(1,6,ZD,EQ,0),                       
       OVERLAY=(1:C'000001'),HIT=NEXT),                   
        IFTHEN=(WHEN=(8,6,ZD,EQ,0),                       
       OVERLAY=(8:C'000001')),IFOUTLEN=80
SORTOUT
Code:
000007 000011
000008 000012
000009 000001
000010 000014
000001 000015
000002 999999
Back to top
View user's profile Send private message
DKartiya

New User


Joined: 30 Jan 2008
Posts: 26
Location: Chennai

PostPosted: Thu Dec 23, 2010 11:44 pm
Reply with quote

Thanks Arun!! This works for me icon_smile.gif
Back to top
View user's profile Send private message
DKartiya

New User


Joined: 30 Jan 2008
Posts: 26
Location: Chennai

PostPosted: Fri Dec 24, 2010 12:02 am
Reply with quote

Had another query, Incase I wanna increment the sequnce nbrs daily ..

say suppose the fmt is
XXXXXX YYYYYY

Both the nbrs are to be incremented everyday and should be reset on reaching the maximum value '999999' to '000001'.

Is it possible to do without the sysnames?

Thanks!!
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sat Dec 25, 2010 1:43 am
Reply with quote

Yes. it is
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 Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top