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 - Increment Nbrs for different weekdays

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - Increment Nbrs for different weekdays
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    Post subject: Reply to: Incrementing Nbrs using SORT card for different we
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: 662
Location: Pennsylvania

PostPosted: Thu Dec 23, 2010 2:18 am    Post subject:
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    Post subject: Reply to: Incrementing Nbrs using SORT card for different we
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: 2275
Location: @my desk

PostPosted: Thu Dec 23, 2010 12:28 pm    Post subject:
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    Post subject: Reply to: Syncsort - Increment Nbrs for different weekdays
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    Post subject: Reply to: Syncsort - Increment Nbrs for different weekdays
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: 2275
Location: @my desk

PostPosted: Sat Dec 25, 2010 1:43 am    Post subject:
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    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 SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 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 Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


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