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

Take a single value out of one datase on ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
NCROLL

New User


Joined: 19 May 2008
Posts: 5
Location: UK

PostPosted: Tue May 20, 2008 3:12 pm
Reply with quote

I want to take a single value out of one dataset and then have this value occur in each record of a 2nd dataset I am to process. Can this be achieved using ICETOOL ?

Here is a working example

Record 1
Code:
12345678901234567890123456789012345678901234567890123456789
000IVP     USER    SCRBOSPRO01NNNNYY N N   N NNN YN      Y0250   
1950101AAPPRO01     051408                    P  200725200811   Y   
1950102A                                                                     
1950103A                                                                     
1950104A    00000000000000{                                                   
1950105AACCOUNTS PAYABLE PROCESSING             


From this record I only want to capture the data from record two for bytes 9 through 26. ie. PRO01 051408


Dataset two coming in looks like this

Code:
                122F06CONTRAF06019999999EUR                         
                122F06988600000013005235EUR                         
                122F06988600000013005251EUR                         
                122F06988600000017502554EUR                         
                122F06988600000017505286EUR                         
                122F06988600000022002538EUR                         


The dataset I want to have as my result would be ….

Code:
PRO01     051408122F06CONTRAF06019999999EUR                         
PRO01     051408122F06988600000013005235EUR                         
PRO01     051408122F06988600000013005251EUR                         
PRO01     051408122F06988600000017502554EUR                         
PRO01     051408122F06988600000017505286EUR                         
PRO01     051408122F06988600000022002538EUR                         



Should I just write this using a cobol program or can ICETOOL actually do this? If so how? From a basic understanding I think SPLICE should be able to do this but right now it is not obvious how.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 20, 2008 9:23 pm
Reply with quote

You don't need SPLICE for this - you can do it quite easily by using DFSORT Symbols as follows:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(11,16,17:SEQNUM,8,ZD)
  OUTFIL INCLUDE=(17,8,ZD,EQ,+2),
    BUILD=(C'CON,''',1,16,C'''',80:X)
/*
//S2  EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file2
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(1:CON)
/*
Back to top
View user's profile Send private message
NCROLL

New User


Joined: 19 May 2008
Posts: 5
Location: UK

PostPosted: Tue May 20, 2008 10:03 pm
Reply with quote

Thanks Frank.

You have made this look very simple but I had never considered building a synames card as input with the constant declared in there captured from the first dataset.

This has opened my eyes about other uses that ICETOOL has.

Once again thanks you for this.
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Wed May 21, 2008 2:24 pm
Reply with quote

Hi ,

I was just wondering what would be case if the second input file had no spaces infront of the record. If we want to append 'PRO01 051408' to all the records in the second file whose records start from column 1, what changes should be made to the above suggested code.

Thanks
Manu
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed May 21, 2008 8:50 pm
Reply with quote

You would change the INREC statement for S2 to:

Code:

  INREC BUILD=(CON,1,n)


where n is the number of bytes you want from the original records (1-n).

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Wed May 21, 2008 9:41 pm
Reply with quote

Thanks a lot Frank. Will look into the document to familiarise myself with DFSORT.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top