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
 
Add file1 value to file2 variable

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

Senior Member


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

PostPosted: Tue Dec 05, 2006 7:45 pm    Post subject: Add file1 value to file2 variable
Reply with quote

Hi,

I have two flat files as below -

file1 (lrecl=6 bytes):
77 constant pic 9(6)

file2 details (lrecl=601 bytes):
Layout-
01 group
03 some_data (595 bytes in lenght)
03 numvar pic 9(6)

File1 always has ONE record. Whereas number of records in File2 varies from run to run.

My requirement is to add the file1 value to NUMVAR of file2. For ex -

file1-
000145

file2-
------------------------
somedata numvar
-------------------------
1record 000001
2record 000005
3record 000018

The resultant file should be -
1record 000146 ----> where 000146 = 000001+000145
2record 000150
3record 000163


At present we are using COBOL program for this purpose. As SORT is more efficient over COBOL, we decided to switch over. Please help me in resolving this.

Regards,
Mohan
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 Dec 05, 2006 9:44 pm    Post subject:
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1 (FB/6)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create DFSORT Symbol as follows with nnnnnn from file1
* Con1,+nnnnnn
  INREC BUILD=(C'Con1,+',1,6,80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file2 (FB/601)
//SORTOUT DD DSN=...  output file (FB/601)
//SYSIN    DD    *
  OPTION COPY
* Add Con1 to numvar in each file2 record.
  INREC OVERLAY=(596:596,6,ZD,ADD,Con1,TO=ZD,LENGTH=6)
/*
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Wed Dec 06, 2006 8:02 am    Post subject:
Reply with quote

Thanks Franks for the resolution.
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Wed Dec 06, 2006 8:14 am    Post subject:
Reply with quote

Very sorry Frank about the name in my earlier post.
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: Wed Dec 06, 2006 10:13 pm    Post subject:
Reply with quote

Quote:
Very sorry Frank about the name in my earlier post.


No problem. I've been called lots worse than "Franks". icon_lol.gif
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Thu Dec 07, 2006 1:10 am    Post subject: Re: Add file1 value to file2 variable
Reply with quote

...tell us , are they printable?
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: Thu Dec 07, 2006 2:20 am    Post subject:
Reply with quote

Some of them. icon_wink.gif
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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm

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