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
 

 

Hex count insertion at footer
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Wed Jul 15, 2009 8:39 pm    Post subject: Hex count insertion at footer
Reply with quote

Hi,

I have a scenario like i need to update the trailer count in hex decimal format

My output trailer record looks like
Code:
  002468  &  M  °É<T 0   
 002469 0090714M  Ìì 
  002470 0090714M    2469
 


We wrote a JCL to insert a new trailer record ( 002470 0090714M 2469). But it's inserting the count as character. Please see the sample SORT CARD below

Code:
SORT FIELDS=COPY                                                   
OUTFIL REMOVECC,                                                   
TRAILER1=(1:X'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 
         26:X'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 
         51:X'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF',         
         72:C'20090714M',                                           
         81:COUNT),OUTREC=(1,2000)                                 
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 Jul 15, 2009 10:01 pm    Post subject:
Reply with quote

Quote:
I have a scenario like i need to update the trailer count in hex decimal format


This is a meaningless statement. All values can be represented in hex format. For example 2469 in character format is X'F2F4F6F9', 2469 in packed decimal format is X'02469C' and 2469 in binary format is X'09A5'. So first you have to tell us what you want the count of 2469 to look like in hex.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Thu Jul 16, 2009 12:14 am    Post subject:
Reply with quote

Frank,

I am sorry to confuse you on this. The scenario is, We have a GDG and we filter the header and trailer record. and sort only required account number.

Now in the trailer record we have the total count which is the total count of GDG records. Right now i am updating the trailer count manually by making HEX ON and changin the record count as per the count in my sorted file.

I need to make that change thru JCL here. Please advice.
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 Jul 16, 2009 1:14 am    Post subject:
Reply with quote

You haven't answered my question, so I still can't help you.

Quote:
But it's inserting the count as character.


When you use COUNT in TRAILER1, it gives you a character count of 8 digits, right-justified with leading zeros suppressed. For example, a count of 2469 would be output as ' 2469' which in hexadecimal is X'40404040F2F4F6F9'. Apparently that's not what you want in the output record, but you haven't told me what you do want in the output record.

Quote:
Right now i am updating the trailer count manually by making HEX ON and changin the record count as per the count in my sorted file.


And what does the record count look like after you change it manually with HEX ON? If you tell me that, I can probably figure out what format you want the count in and help you. Without that information, I still don't know what you want.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Thu Jul 16, 2009 2:23 am    Post subject:
Reply with quote

Frank,

I use to open the file after sorting and give hex on in the command prompt I will see as below

Code:
000020 0090331M 
       FFFFFFFD00240
       009033140002C


Here 20420 is the total GDG count.
Now the record count is 20 so i will change the total count as

Code:
000020 0090331M 
       FFFFFFFD00000
       009033140002C


This is what i want to do thru JCL. I need to update the hex value in the trailercount. Please let me know if i am still not clear.
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 Jul 16, 2009 2:43 am    Post subject:
Reply with quote

Ah, clarity at last. You want a 5-byte PD value for the count (e.g. X'000000020C'). You can change your OUTFIL statement to the following for that:

Code:

  OUTFIL REMOVECC,                     
   TRAILER1=(1:25X'FF',                 
            26:25X'FF',                 
            51:21X'FF',                 
            72:C'20090714M',           
            81:COUNT=(TO=PD,LENGTH=5)),
   BUILD=(1,2000)                       
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Thu Jul 16, 2009 3:27 am    Post subject:
Reply with quote

Frank,

You are always perfect!

Now i got two questions with you,

1. When i run the JCL with this sort card, it's creating a new trailer record instead of updating the existing trailer record. Is it like we cant update and only insert is possible?

2. In 72:C'20090714M', 20090714 is dynamic. To be more trailer date comes from the GDG. How do we give the dynamic sort card here?
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 Jul 16, 2009 3:35 am    Post subject:
Reply with quote

Quote:
We wrote a JCL to insert a new trailer record


I just modified your control statements that do this.

Quote:
1. When i run the JCL with this sort card, it's creating a new trailer record instead of updating the existing trailer record. Is it like we cant update and only insert is possible?

2. In 72:C'20090714M', 20090714 is dynamic. To be more trailer date comes from the GDG. How do we give the dynamic sort card here?


I can't read your mind. You have to give me the information I need to help you.

1. If you want to update the existing trailer record, you need to tell me what the existing trailer record looks like and what the new trailer record should look like. Which fields from the existing trailer record do you want to keep? Which fields do you want to update? What's in those fields?

2. What do you mean "trailer date comes from the GDG"? Is it in a record in the GDG? If so, how can that record and field be identified and what does it look like? If the date is somewhere else, explain exactly where it is. Is the date by any chance the current date or the current date plus or minus some number of days? Or is it something hardcoded? Be specific.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jul 16, 2009 3:35 am    Post subject:
Reply with quote

k.a.khamaurutheen,

Are there anymore MINOR little changes that you have forgotten to mention?
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Fri Jul 17, 2009 12:12 am    Post subject:
Reply with quote

Frank,

We wanted to keep all the field values in trailer record except up that we want to update the count of records in trailer record. From 81th byte of trailer record we have 5 bytes of packed value to be populated for count of records.
Code:
 OUTFIL REMOVECC,                     
   TRAILER1=(1:71X'FF',   
            72:C'20090714M',           
            81:COUNT=(TO=PD,LENGTH=5)),
   BUILD=(1,2000) 
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: Fri Jul 17, 2009 12:41 am    Post subject:
Reply with quote

Let's start over. Show me an example of the records in your input file (relevant fields only) and what you expect for the output records. If there's something in the trailer record that distinguishes it from the other records in the file, tell me what that is (e.g. X'FF' in position 1). Tell me the RECFM and LRECL of the input file.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Fri Jul 17, 2009 2:53 am    Post subject:
Reply with quote

frank,

it's different from other records where the first 72 bytes has the high values.

I shall try to pull you the example from our file soon.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Sat Jul 18, 2009 1:13 am    Post subject:
Reply with quote

Frank,

My records look like below

Code:
B0  M  °É<T 0                    °É<  °É@0S1985D1  °É< rd 341268
          M  °É<1nitel retail cord A95-208 KAPONOE PLACE
00  &  M  °É<T 0                    °É<  °É@1S29G001  °É< Ê @T40550
          M  °É<3 commercial bank FTP K3 LL
01  &  M  °É<T 0                    °É<  °É@0S19F006  °É< p/ V04586
  20090714M  Ìì 


I just copied from 68th position to 130 th position.

Please let me know if ay more info req
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Jul 18, 2009 2:20 am    Post subject:
Reply with quote

khamarutheen,

The following DFSORT JCL will give you the desired results. The job assumes that only the trailer record will have x'ff' in the first 71 bytes


Code:

//STEP0100 EXEC PGM=SORT                                   
//SYMNAMES DD *                                             
TVAL,X'FFFFFFFFFFFFFFFFFFFF'                               
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=your input file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                         
  INREC IFOUTLEN=2000,                                     
  IFTHEN=(WHEN=INIT,OVERLAY=(2001:SEQNUM,5,PD)),           
  IFTHEN=(WHEN=(01,10,CH,EQ,TVAL,AND,11,10,CH,EQ,TVAL,AND, 
                21,10,CH,EQ,TVAL,AND,31,10,CH,EQ,TVAL,AND, 
                41,10,CH,EQ,TVAL,AND,51,10,CH,EQ,TVAL,AND, 
                61,10,CH,EQ,TVAL,AND,71,01,CH,EQ,X'FF'),   
  OVERLAY=(81:2001,5))                                     
/*
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Jul 21, 2009 3:24 am    Post subject:
Reply with quote

Kolusu,

Thanks for your help! But still it's not working. I dont see any updation in my output file!
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Jul 21, 2009 3:28 am    Post subject:
Reply with quote

FYI,

O/P record is showing like

Code:
------------------------------------------------------------------------------
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
002469  2
       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
       FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2
------------------------------------------------------------------------------
--------------------------------------------------------------------
--+----8----+----9----+----0----+----1----+----2----+----3----+----4-
0090714M  Ìì 
FFFFFFFD00752FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
009071440088CFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
--------------------------------------------------------------------


Except that it should show like


Code:
7----+----8----+-
  20090714M  Ìì 
FFFFFFFFFFD00049F
FF2009071440026CF


2469 is the total count of the output file
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jul 21, 2009 3:31 am    Post subject: Reply to: Hex count insertion at footer
Reply with quote

khamarutheen,

The job will ONLY update the record if the first 71 bytes are x'FF' . Are you sure that your first 71 bytes are x'FF' for the trailer record?
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Jul 21, 2009 3:32 am    Post subject:
Reply with quote

Please see the output above kolusu and let me know if anything more info required.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jul 21, 2009 3:39 am    Post subject:
Reply with quote

khamarutheen,

Another Important Q is your input a VB file? If so you need to account for RDW
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Jul 21, 2009 3:56 am    Post subject:
Reply with quote

FYI,

Code:

Organization  . . . : PS   
Record format . . . : FB   
Record length . . . : 2000
Block size  . . . . : 18000
1st extent megabytes: 4   
Secondary megabytes : 40 
 
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
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 Update the Sortout file with record c... karthik_sripal SYNCSORT 8 Tue May 17, 2016 8:52 pm
No new posts CQM : Exec count is 0 but getpages &g... soundarr DB2 1 Thu Mar 17, 2016 10:08 pm
No new posts JCL SORT to split the file and put re... Bill Woodger DFSORT/ICETOOL 17 Wed Feb 17, 2016 4:17 pm


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