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
 
Copy 4 byte of data from the last record of a dataset

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

New User


Joined: 13 Jul 2016
Posts: 26
Location: India

PostPosted: Fri Oct 06, 2017 12:15 pm    Post subject: Copy 4 byte of data from the last record of a dataset
Reply with quote

Hey Team,

I need to copy 4 byte of data from the last record of a dataset. For the same I found a ICETOOL code to get last record but I am unable to get the 4bytes from 10th column.

Code:
//S1   EXEC  PGM=ICETOOL                                     
 //TOOLMSG   DD  SYSOUT=*                                     
 //DFSMSG    DD  SYSOUT=*                                     
 //SORTIN DD *                                               
 REC1 abce1234                                                         
 REC2 abcd1231                                                         
 REC3 abcc1232                                                       
 REC4 abcb1233                                                         
 REC5 acbb1244                                                         
 //SORTOUT DD SYSOUT=*                                       
 //TOOLIN DD *                                               
  SELECT FROM(SORTIN) TO(SORTOUT) LAST ON(81,1,CH) USING(CTL1)
 /*                                                           
 //CTL1CNTL DD *                                             
  INREC OVERLAY(81:C'1')
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1894
Location: UK

PostPosted: Fri Oct 06, 2017 3:04 pm    Post subject:
Reply with quote

Nothing to do with JCL & VSAM. All to do with ICETOOL. Moved.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1806
Location: NY,USA

PostPosted: Fri Oct 06, 2017 7:57 pm    Post subject:
Reply with quote

Try this ( first 4 bytes)..
Code:
//SYSIN    DD *                           
   SORT FIELDS=COPY                       
   OUTFIL REMOVECC,NODETAIL,TRAILER1=(1,4)
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 26
Location: India

PostPosted: Fri Oct 06, 2017 10:08 pm    Post subject:
Reply with quote

Hey Rohit thanks for the response...!!!

Below code worked for me...
Code:

//S1 EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SIN1  DD DSN=dataset1,
//SORTOUT DD DSN= .... ,
//TOOLIN DD *
   SUBSET FROM(SIN1) TO(SORTOUT) KEEP INPUT LAST USING(CTL1)
/*
//CTL1CNTL  DD *
   INREC BUILD=(8,4)
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1806
Location: NY,USA

PostPosted: Fri Oct 06, 2017 11:01 pm    Post subject:
Reply with quote

Glad , You found out a way by yourself!!
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 26
Location: India

PostPosted: Mon Oct 09, 2017 9:26 am    Post subject:
Reply with quote

Hi Team

For the same job I am not able to get the data from more than one dataset into one. I am getting only the data present in last dataset provided in SIN2. Please have a look to below code and let me know what went wrong:-

Code:
//S1     EXEC PGM=ICETOOL                                     
//TOOLMSG DD SYSOUT=*                                         
//DFSMSG  DD SYSOUT=*                                         
//SIN1    DD DSN=ABCD.EFGH(0),                     
//           DISP=SHR                                         
//SIN2    DD DSN=ABCD.IJKL(0),                 
//           DISP=SHR                                         
//TEMPF   DD DSN=&&TEMPF,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//SORTOUT DD DSN=G7UST.JOB.FILE.SEQNO.OUT,                     
//           DISP=(NEW,CATLG,DELETE),                         
//           DATACLAS=STANDARD,                               
//           DCB=(DSORG=PS,RECFM=FB)                           
//TOOLIN  DD *                                                 
  SUBSET FROM(SIN1) TO(TEMPF) KEEP INPUT LAST USING(CTL1)     
  SUBSET FROM(SIN2) TO(TEMPF) KEEP INPUT LAST USING(CTL2)     
  SORT FROM(TEMPF) TO(SORTOUT) USING(CTL3)                     
/*                                                             
//CTL1CNTL DD *                                               
  INREC BUILD=(8,4)   
//CTL2CNTL DD *           
  INREC BUILD=(8,4)       
//CTL3CNTL DD *           
  SORT FIELDS=(1,80,CH,A)     
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1894
Location: UK

PostPosted: Mon Oct 09, 2017 2:30 pm    Post subject:
Reply with quote

Pre-allocate your output dataset and write to it with a DISP of MOD.
Back to top
View user's profile Send private message
arunsoods

New User


Joined: 13 Jul 2016
Posts: 26
Location: India

PostPosted: Mon Oct 09, 2017 4:07 pm    Post subject:
Reply with quote

Thnaks Nic it works. But If there no option of pre-allocation of dataset.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2442
Location: Netherlands, Amstelveen

PostPosted: Mon Oct 09, 2017 8:04 pm    Post subject:
Reply with quote

Allocation with a DISP=(MOD...) in the same step is not working?
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1806
Location: NY,USA

PostPosted: Mon Oct 09, 2017 8:38 pm    Post subject:
Reply with quote

Quote:
For the same job I am not able to get the data from more than one dataset into one. I am getting only the data present in last dataset provided in SIN2. Please have a look to below code and let me know what went wrong:-
I just ran it and it worked. Of course, You are referring to wrong data sets in the output when you checking 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 opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts XMITIP sends it out. Can it copy on l... Rommel Dayon Rustia IBM Tools 0 Tue Sep 05, 2017 10:16 am
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am

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