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
 

 

Concatinate two files and truncate the file length to 75

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Concatinate two files and truncate the file length to 75
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 20, 2007 1:25 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 1:45 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 20, 2007 1:49 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 1:59 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 20, 2007 2:06 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Tue Mar 20, 2007 2:29 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 20, 2007 3:05 pm    Post subject:
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 Moderator


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

PostPosted: Tue Mar 20, 2007 8:41 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 20, 2007 8:52 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 20, 2007 8:55 pm    Post subject:
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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