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
 

 

Utility that increments a number in the first record only?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Oct 04, 2006 3:59 am    Post subject: Utility that increments a number in the first record only?
Reply with quote

Hi all,
I'm wondering if any of you know of a utility that can do the following....without spending very much time on this....
1) file is 400 bytes.
2) the 1st record is a "rollyear" record and only contains data in bytes 14-20 something like 2005000 and the rest of the record contains packed 0 or spaces. It is the same format as the rest of the records
3) all other records contain data in the fields,...not 0.
4) Without doing it manually, can the that 1st record be updated to Add 1 to the year in bytes 14-17 and write out all other records as is? So, for this sample file the new output would be 2006000 in bytes 14-20.

If you know of an "easy" way, without writing a program or without "hard coding" the value, please let me know.

Thank-you,
Back to top
View user's profile Send private message

Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Oct 04, 2006 4:08 am    Post subject: Re: Utility that increments a number in the first record onl
Reply with quote

I forgot to post a sample of the file data. Here it is:

.............2005000 .........................................................
0000000000000FFFFFFF444000000000000000000000000000000000000000000000000000000000
00000C000C00C2005000000000000C000000C000000C000000C000000C000000C000000C000000C0
------------------------------------------------------------------------------
.. .........%2005000 ....................*......*.............................
0040032000006FFFFFFF444000000000000000000505000050500000000000000000000000000000
20010C051C01C2005000000000000C000000C000180C000180C000000C000000C000000C000000C0
------------------------------------------------------------------------------
.. .........%2005000 ....................%......%.............................
0040082000006FFFFFFF444000000000000000000416000041600000000000000000000000000000
20012C051C01C2005000000000000C000000C000255C000255C000000C000000C000000C000000C0
------------------------------------------------------------------------------
.. .........%2005001 ....................)......@.............................
0040082000006FFFFFFF444000000000000000000065000006700000000000000000000000000000
20012C041C01C2005001000000000C000000C000005D000093C000000C000000C000000C000000C0
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: Wed Oct 04, 2006 4:26 am    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/400)
//SORTOUT DD DSN=...  output file (FB/400)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=400,
        IFTHEN=(WHEN=INIT,OVERLAY=(401:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(401,8,ZD,EQ,+1),
          OVERLAY=(14:14,4,ZD,ADD,+1,TO=ZD,LENGTH=4))
/*
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Oct 04, 2006 4:46 am    Post subject:
Reply with quote

Frank,
That really works great!
Thanks!
Sysaron
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Oct 04, 2006 6:11 am    Post subject:
Reply with quote

Frank,

I understand most of the input statements, but why use 401 in these two areas please?
IFTHEN=(WHEN=INIT,OVERLAY=(401:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(401,8,ZD,EQ,+1),

Sysaron
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: Wed Oct 04, 2006 8:22 pm    Post subject:
Reply with quote

You said "file is 400 bytes". Since we only need the sequence number temporarily to check for record number 1, we put it at the end of the record (positions 401-408) and remove it (with IFOUTLEN=400) when we're done with it.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TAPE VERIFY utility?? MrExtraordinare JCL & VSAM 3 Fri Dec 09, 2016 10:57 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Best IMS DB Unload Utility jjabez10 IMS DB/DC 12 Thu Sep 22, 2016 11:15 pm


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