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

Concatinate two files and truncate the file length to 75


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

New User


Joined: 20 Mar 2007
Posts: 1
Location: mumbai

PostPosted: Tue Mar 20, 2007 1:21 pm
Reply with quote

i am having a sort step as below

SORT02 EXEC PGM=SORT,COND=(1000,EQ)
SORTIN DD DSN=DWPC.DW925EXT.A.DATA01(+1),
DISP=SHR
DD DSN=DWPC.DW92511A.A.TATC108.LOAD01(0),
DISP=SHR
SORTOF1 DD DSN=DWPC.DW92511A.A.TATC108.LOAD01.SRTD(+1),
DISP=(NEW,CATLG,DELETE),
UNIT=VTSTAPE,
* UNIT=SYSDA,
* SPACE=(CYL,(1500,800),RLSE),
DCB=(PSDSCB,BLKSIZE=0,LRECL=75,RECFM=FB)
SYSIN DD DSN=CORPC.CNTLCARD(DW925S02),DISP=SHR

file DWPC.DW925EXT.A.DATA01 is having logical record length of 75 and file DWPC.DW92511A.A.TATC108.LOAD01 is having a record length of 88. while doing this step is abending, when i am putting the file DWPC.DW92511A.A.TATC108.LOAD01 first and then the file DWPC.DW925EXT.A.DATA01 then also the step is abending,while the output file is of length 75. i need to concatinate these two files and truncate the file to 75 length in this step. can you provide me a solution.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 20, 2007 1:25 pm
Reply with quote

What are you doing with the SYSIN cards ? Are you reformatting the records or just sorting them.

What did you find in the manual about this.

Which SORT product are you using.

Where are the error messages.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 1:45 pm
Reply with quote

Your JCL doesn't have SORTOUT instead you have -

Quote:


SORTOF1 DD DSN=DWPC.DW92511A.A.TATC108.LOAD01.SRTD(+1),
DISP=(NEW,CATLG,DELETE),
UNIT=VTSTAPE,
* UNIT=SYSDA,
* SPACE=(CYL,(1500,800),RLSE),
DCB=(PSDSCB,BLKSIZE=0,LRECL=75,RECFM=FB)



If this is not a typo error, please put SORTOUT and execute the job. Also, reformat the lrecl=88 file to 75 before concatenation the files in sortin.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 20, 2007 1:49 pm
Reply with quote

Quote:
reformat the lrecl=88 file to 75 before concatenation the files in sortin.


You can easily reformat the records during the SORT process using INREC / OUTREC, so why would you want to introduce an extra process when it is not required.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 1:59 pm
Reply with quote

Expat,

Quote:

You can easily reformat the records during the SORT process using INREC / OUTREC, so why would you want to introduce an extra process when it is not required.


You will get the following cc=16, when you try to concatenate the 88 and 75 files with the following control card

Control card:
Code:
INREC FIELDS=(1,75)
SORT FIELDS=COPY


Error message taken from the spool:

Code:
ICE063A 2 OPEN ERROR SORTIN
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 20, 2007 2:06 pm
Reply with quote

But not if the records are reformatted during the sort process,
i.e. the 88 byte record has only 75 bytes extracted from it.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 2:29 pm
Reply with quote

Expat,

This was the JCL which had returned maxcc=16

Code:

//SORTIN DD DSN=&SYSUID..FIRST.LEN88,DISP=SHR
//       DD DSN=&SYSUID..FIRST.LEN75,DISP=SHR
//SORTOUT DD DSN=&SYSUID..OUT.LEN75,DISP=(,CATLG,DELETE),
//       SPACE=(TRK,1,RLSE),LRECL=75,RECFM=FB
//SYSIN DD *
  INREC FIELDS=(1,75)
  SORT FIELDS=COPY
/*



So, reformat the 88 lenght file first. Later concatenate this OP file with 75 lenght.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 20, 2007 3:05 pm
Reply with quote

Mmmmmmmmmmmmmm, I stand corrected on this one.

Can do it with ICETOOL in one job step, but it does reformat before concatenation.

I'd be very interested in seeing Franks answer to this one.
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 Mar 20, 2007 8:41 pm
Reply with quote

rohit,

You can't concatenate two FB data sets with different LRECLs that way with DFSORT. From "z/OS DFSORT Application Programming Guide":

Quote:
With fixed-length records, LRECL must be the same for all data sets. With variable-length records, LRECL can vary.


You can do what you want with a DFSORT/ICETOOL job like this. Note that the OUT data set must be MOD.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=DWPC.DW925EXT.A.DATA01(+1),
//       DISP=SHR    (FB/75)
//IN2 DD DSN=DWPC.DW92511A.A.TATC108.LOAD01(0),
//       DISP=SHR    (FB/88)
//OUT DD DSN=DWPC.DW92511A.A.TATC108.LOAD01.SRTD(+1),
//       DISP=(MOD,CATLG,DELETE),
//       UNIT=VTSTAPE,
//*      UNIT=SYSDA,
//*      SPACE=(CYL,(1500,800),RLSE),
//       DCB=(PSDSCB,BLKSIZE=0,LRECL=75,RECFM=FB)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT)
COPY FROM(IN2) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
  INREC FIELDS=(1,75)
/*
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 20, 2007 8:52 pm
Reply with quote

Thanks Frank,

Great use of DISP=MOD, as I had done it by truncating the first file and then a copy using referbacks to the two datasets to be concatenated.

Looking at the size of the files from the space allocations it looks as though I may have hit the problem when a file goes to a second volume and is ignored using referbacks.

Nice one Frank, definitely one to remember.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 20, 2007 8:55 pm
Reply with quote

Quote:
second volume and is ignored using referbacks.


Should have read ....

second volume and is partially ignored when using referbacks.
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top