Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Updating Count After Splice

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

New User


Joined: 09 Feb 2008
Posts: 6
Location: Mumbai

PostPosted: Fri Oct 02, 2009 2:52 am    Post subject: Updating Count After Splice
Reply with quote

Hi,

I have two files and would like to write on output file if they match.
I have another file it contains only trailer record. I need to update this file with actual number of matched records. Could you please help efficient way to do this.

What I know is use ICETOOL Splice operator to match two files. But to get the count use ICEMAN facility to get the count and write on to temp file. Then in next step take that temp count value and overlay on existing trailer record.

My Input files are looks like this:

File-1:

12345
12346
12348

File-2:

12345abcdtest11
12345abcetest12
12347abcdtest14
12348abcdtest14

Trailer File:

trailer00004abcd

Expected Output:

Output data file:
12345abcdtest11
12345abcetest12
12348abcdtest14

Trailer:

trailer00003abcd

It would be greatful if you can provide simple way to do this.

Regards,
Sreeni
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Fri Oct 02, 2009 3:20 am    Post subject: Reply to: Updating Count After Splice
Reply with quote

csreenivasulu,

Please answer the following questions

1. What is the LRECL and RECFM of file1
2. What is the LRECL and RECFM of file2
3. What is the position of the key and format of the key in file1?
4. What is the position of the key and format of the key in file2?
5. Does any of the file have duplicates on the key
6. What is the LRECL and RECFM of the Matched file?
7. what is the LRECL and RECFM of the trailer file?

8. run this job and show me the sysout
Code:

//STEP0100 EXEC PGM=SORT     
//SYSOUT   DD SYSOUT=*       
//SORTIN   DD *               
A                             
//SORTOUT  DD SYSOUT=*       
//SYSIN    DD *               
  SORT FIELDS=COPY           
/*
Back to top
View user's profile Send private message
csreenivasulu

New User


Joined: 09 Feb 2008
Posts: 6
Location: Mumbai

PostPosted: Fri Oct 02, 2009 1:49 pm    Post subject:
Reply with quote

Hi Kolusu,
Thanks for your reply.
Please find answers for your queries below.
1. What is the LRECL and RECFM of file1

LRECL=9, RECFM=FB

2. What is the LRECL and RECFM of file2

LRECL=175,RECFM=FB

3. What is the position of the key and format of the key in file1?
POSITION OF THE KEY:1, FORMAT = CH
4. What is the position of the key and format of the key in file2?
POSITION OF THE KEY:1, FORMAT = CH
5. Does any of the file have duplicates on the key ?
yES. File 2 contains duplicates
6. What is the LRECL and RECFM of the Matched file?
LRECL=175,RECFM=FB
7. what is the LRECL and RECFM of the trailer file?
LRECL=80,RECFM=FB, Count need to put on position 5 and length 14.

8. Please find the sysout from the above job.


Display Filter View Print Options Help
-------------------------------------------------------------------------------
SDSF OUTPUT DISPLAY DEVDW14X JOB25897 DSID 104 LINE 0 COLUMNS 01- 80
COMMAND INPUT ===> SCROLL ===> CSR
********************************* TOP OF DATA **********************************
1ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 09:12 ON FRI OC
0 SORT FIELDS=COPY
ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E9-K90007 C9-BASE E5-K18181
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED
ICE088I 0 DEVDW14X.PSTP010 . , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXIT
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAM
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
ICE751I 1 EF-K10929 F0-Q84357 E8-K19114
ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 1, OUT: 1
ICE026I 1 SMF RECORD NOT WRITTEN TO THE SMF DATA SET(RC=20)
ICE052I 0 END OF DFSORT
******************************** BOTTOM OF DATA *******************************

Once again thanks for your help.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Oct 02, 2009 9:20 pm    Post subject: Reply to: Updating Count After Splice
Reply with quote

csreenivasulu,

The following DFSORT/ICETOOL JCL will give you the desired results. I assumed the key you want to compare is 9 bytes


Code:

//STEP0100 EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//F009     DD DSN=Your 9 byte unq key file,DISP=SHR
//F175     DD DSN=your 175 byte master file,DISP=SHR
//TEMP     DD DSN=&&TEMP,DISP=(MOD,PASS),SPACE=(CYL,(X,Y),RLSE)   
//OUT      DD SYSOUT=*                                             
//UPDTRLR  DD SYSOUT=*                                             
//TOOLIN   DD *                                                   
  COPY FROM(F009) USING(CTL1)                                     
  COPY FROM(F175) USING(CTL2)                                     
  SPLICE FROM(TEMP) TO(OUT) ON(1,9,CH) WITH(1,175) WITH(177,1) -   
  WITHALL USING(CTL3)                                             
//CTL1CNTL DD *                                                   
  OUTFIL FNAMES=TEMP,BUILD=(1,9,176:C'11')                         
//CTL2CNTL DD *                                                   
  OUTFIL FNAMES=TEMP,OVERLAY=(176:C'22')                           
//CTL3CNTL DD *                                                   
  OUTFIL FNAMES=OUT,BUILD=(1,175),INCLUDE=(176,2,ZD,EQ,12)         
  OUTFIL FNAMES=UPDTRLR,REMOVECC,NODETAIL,BUILD=(80X),             
  INCLUDE=(176,2,ZD,EQ,12),TRAILER1=('TRLR',COUNT=(M11,LENGTH=14))
//*
Back to top
View user's profile Send private message
csreenivasulu

New User


Joined: 09 Feb 2008
Posts: 6
Location: Mumbai

PostPosted: Mon Oct 05, 2009 9:39 pm    Post subject: Reply to: Updating Count After Splice
Reply with quote

Hi Skolusu,

Thank you very much for your help. I ran this code and got expected results.
Back to top
View user's profile Send private message
csreenivasulu

New User


Joined: 09 Feb 2008
Posts: 6
Location: Mumbai

PostPosted: Tue Oct 06, 2009 1:49 am    Post subject: Reply to: Updating Count After Splice
Reply with quote

Sorry to trouble you again. As I wrote earlier I got almost the results I wanted, but I want to override the existing trailer file. The trailer file first 5 bytes contains file creation date in packed format. Would it possible with OVERLAY option. I tried with this option, but Syntax not correct.

Regards
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Oct 06, 2009 4:21 am    Post subject: Reply to: Updating Count After Splice
Reply with quote

csreenivasulu,

Quote:
Sorry to trouble you again. As I wrote earlier I got almost the results I wanted, but I want to override the existing trailer file. The trailer file first 5 bytes contains file creation date in packed format. Would it possible with OVERLAY option. I tried with this option, but Syntax not correct.


Is it that date the current date? or any other date? Do you have any other fields that you need to retain from that trailer file?
Back to top
View user's profile Send private message
csreenivasulu

New User


Joined: 09 Feb 2008
Posts: 6
Location: Mumbai

PostPosted: Tue Oct 06, 2009 1:51 pm    Post subject:
Reply with quote

Skolusu,

This date is some other date, not current date. I have another field to retain in the file. First 5 bytes date, next 14bytes count, after that 8bytes program name.

Regards
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Oct 06, 2009 9:37 pm    Post subject: Reply to: Updating Count After Splice
Reply with quote

csreenivasulu,

use the following JCL which will give you the desired results

Code:

//STEP0050 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN=Your existing trailer file,DISP=SHR
//SORTOUT  DD DSN=&&S,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)     
//SYSIN    DD *
  OPTION COPY,STOPAFT=1                                       
  OUTFIL BUILD=(C'INPDATE,C''',01,5,C'''',/,                 
                C'PGMNAME,C''',20,8,C'''',80:X)               
//*                                                           
//STEP0100 EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*
//SYMNAMES DD DSN=&&S,DISP=SHR                                             
//F009     DD DSN=Your 9 byte unq key file,DISP=SHR
//F175     DD DSN=your 175 byte master file,DISP=SHR
//TEMP     DD DSN=&&TEMP,DISP=(MOD,PASS),SPACE=(CYL,(X,Y),RLSE)   
//OUT      DD SYSOUT=*                                             
//UPDTRLR  DD DSN=Your existing trailer file,DISP=SHR
//TOOLIN   DD *                                                   
  COPY FROM(F009) USING(CTL1)                                     
  COPY FROM(F175) USING(CTL2)                                     
  SPLICE FROM(TEMP) TO(OUT) ON(1,9,CH) WITH(1,175) WITH(177,1) -   
  WITHALL USING(CTL3)                                             
//CTL1CNTL DD *                                                   
  OUTFIL FNAMES=TEMP,BUILD=(1,9,176:C'11')                         
//CTL2CNTL DD *                                                   
  OUTFIL FNAMES=TEMP,OVERLAY=(176:C'22')
//CTL3CNTL DD *                                               
  OUTFIL FNAMES=OUT,BUILD=(1,175),INCLUDE=(176,2,ZD,EQ,12)     
  OUTFIL FNAMES=UPDTRLR,REMOVECC,NODETAIL,BUILD=(80X),         
  INCLUDE=(176,2,ZD,EQ,12),                                   
  TRAILER1=(INPDATE,COUNT=(M11,LENGTH=14),PGMNAME)             
//*                                                           
Back to top
View user's profile Send private message
csreenivasulu

New User


Joined: 09 Feb 2008
Posts: 6
Location: Mumbai

PostPosted: Thu Oct 08, 2009 1:45 am    Post subject: Reply to: Updating Count After Splice
Reply with quote

Dear Skolusu,

Thank you for your help. I have followed your instructions and it worked.

Regards
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Splice more than 50 occurances rajatbagga DFSORT/ICETOOL 1 Wed Oct 11, 2017 9:36 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us