View previous topic :: View next topic
|
Author |
Message |
arunsoods
New User
Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Nothing to do with JCL & VSAM. All to do with ICETOOL. Moved. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Try this ( first 4 bytes)..
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,TRAILER1=(1,4) |
|
|
Back to top |
|
|
arunsoods
New User
Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Glad , You found out a way by yourself!! |
|
Back to top |
|
|
arunsoods
New User
Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Pre-allocate your output dataset and write to it with a DISP of MOD. |
|
Back to top |
|
|
arunsoods
New User
Joined: 13 Jul 2016 Posts: 35 Location: India
|
|
|
|
Thnaks Nic it works. But If there no option of pre-allocation of dataset. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Allocation with a DISP=(MOD...) in the same step is not working? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
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 |
|
|
|