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
 

 

Take a single value out of one datase on ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Take a single value out of one datase on ICETOOL
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 Moderator


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

PostPosted: Tue May 20, 2008 9:23 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Take a single value out of one datase on ICETOOL
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 Moderator


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

PostPosted: Wed May 21, 2008 8:50 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject:
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    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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm


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