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
 

 

Handling two files of different Lrecl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Mon Jul 11, 2011 1:57 pm    Post subject: Handling two files of different Lrecl
Reply with quote

Hi,

I have a requirement to check a particular value in the file1 and depending on it write 3 files.

INPUT FILE 1
RECFM - FB
LRECL - 2099

INPUT FILE 2
RECFM - FB
LRECL - 224

O/P files:
a) O/p file1 ---> Copy of file 2
b) O/p file2 ---> Copy of file 2
c) O/P file3----> Only one recrod - Date from file1 starting from position 1 to 8 (DD/MM/YY) and Number of records in file2

Conditions:
1)IF file 1 is having A/B in position 20, create output files
2)If File 1 is empty then the following o/p msg needs to be populated in sysout "File is empty"
3)If File 1 is has no "A/B" in postion 20 - then the following o/p msg needs to be populated in sysout "Invalid file"

In 2nd and 3rd condition it shld also set return code of 12.

If my requirements are not clear, please let me know.
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1491
Location: Chennai

PostPosted: Mon Jul 11, 2011 2:21 pm    Post subject:
Reply with quote

Hello,
Do you want this to be done using REXX or JCL + DFSORT or JCL + SYNCSORT or anything else?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jul 11, 2011 2:26 pm    Post subject: Reply to: Handling two files of different Lrecl
Reply with quote

I don't understand the significance of the title you gave this?

I don't get how you need two copies of File 2, identical to each other and File 2. Isn't there a possibility of just using File 2 instead of those files?

Is File 1 a single-record file? If so, are you saying you need RC=0 when file contains data and position 20 = A or B, otherwise you need "File is empty" and "Invalid file" respectively, with RC=12?
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Mon Jul 11, 2011 2:45 pm    Post subject:
Reply with quote

Quote:
Do you want this to be done using REXX or JCL + DFSORT or JCL + SYNCSORT or anything else?

I am looking for JCL + SYNCSORT.

Quote:
I don't understand the significance of the title you gave this?

icon_redface.gif I never thought this question would arrive. Handling two files is the difficult part here and i thought that would be the perfect heading for this.

Quote:
I don't get how you need two copies of File 2, identical to each other and File 2. Isn't there a possibility of just using File 2 instead of those files?

These files are used by other applications and they are altering these files. Just to avoid the risk we are providing them different file names with the same data.

Quote:
Is File 1 a single-record file? If so, are you saying you need RC=0 when file contains data and position 20 = A or B, otherwise you need "File is empty" and "Invalid file" respectively, with RC=12?


Yes you are correct, for condition 1 it should provide RC=0 and for other two conditions it should provide RC=12.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jul 11, 2011 2:57 pm    Post subject:
Reply with quote

[quote="kratos86"]
Quote:
[...]
Quote:
I don't understand the significance of the title you gave this?

icon_redface.gif I never thought this question would arrive. Handling two files is the difficult part here and i thought that would be the perfect heading for this.

Quote:
I don't get how you need two copies of File 2, identical to each other and File 2. Isn't there a possibility of just using File 2 instead of those files?

These files are used by other applications and they are altering these files. Just to avoid the risk we are providing them different file names with the same data.

Quote:
Is File 1 a single-record file? If so, are you saying you need RC=0 when file contains data and position 20 = A or B, otherwise you need "File is empty" and "Invalid file" respectively, with RC=12?


Yes you are correct, for condition 1 it should provide RC=0 and for other two conditions it should provide RC=12.


If the files are flat files, they are not being altered by anything.

If you really want to stick to two copies of the file:

1) Process the File 1 as per spec
2) If zero RC from 1), produce two identical copies of File 2

I now get your title. The thing is, you're not actually sorting the records together, so the problem doesn't really exist.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1755
Location: Bloomington, IL

PostPosted: Tue Jul 12, 2011 1:45 am    Post subject:
Reply with quote

Bill Woodger wrote:
kratos86 wrote:

These files are used by other applications and they are altering these files. Just to avoid the risk we are providing them different file names with the same data.


If the files are flat files, they are not being altered by anything.

But could they not be altered by a program that opens them for update-in-place? One could certainly do this in HLASM and PL/I; I don't know COBOL well enough to say if a COBOL program could do this, although I'd venture to guess that it could.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Jul 12, 2011 4:12 am    Post subject:
Reply with quote

Akatsukami wrote:
Bill Woodger wrote:
kratos86 wrote:

These files are used by other applications and they are altering these files. Just to avoid the risk we are providing them different file names with the same data.


If the files are flat files, they are not being altered by anything.

But could they not be altered by a program that opens them for update-in-place? One could certainly do this in HLASM and PL/I; I don't know COBOL well enough to say if a COBOL program could do this, although I'd venture to guess that it could.


Well, I've just had a look and it does look easy in Cobol. I've definitely never done it, but now I know it can be done. Thanks Akatsukami, another new thing for the day :-)

Kratos86, if they are updating the files in place gently remind them to back them up first, so they don't have to go back to your system for a re-run.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts WER247A incompatible lrecl Danielle.Filteau SYNCSORT 8 Tue May 02, 2017 4:04 am
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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