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

Can we overlay two files to prepare a dynamic cntl card


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

New User


Joined: 26 Sep 2007
Posts: 7
Location: Chennai

PostPosted: Sat Dec 13, 2008 12:35 am
Reply with quote

Hi,

Can any one help me out in joining the two files to prepare a dynamic cntl card?

File 1 - will have 2 rows.
Row1 sort fields=copy
Row2 Include condition

I need to get the date from file 2 and place that in 27th position of the 2nd row in file1 as shown below.

File1:
SORT FIELDS=COPY
INCLUDE COND=(39,4,PD,GE,<date from file2> ,AND,43,4,PD,GT,<time from file2>)

File2:
will have the date in CYYMMDD format and time in HHMMSS.

Output should be like below:
SORT FIELDS=COPY
INCLUDE COND=(39,4,PD,GE,1081212,AND,43,4,PD,GT,123333)
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sat Dec 13, 2008 12:53 am
Reply with quote

How two topics can be this similar?
ibmmainframes.com/viewtopic.php?t=36687
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Dec 13, 2008 2:29 am
Reply with quote

Same homework assignment. . .?
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: Sat Dec 13, 2008 6:56 am
Reply with quote

And I received the same question in a private message. Here's the response I gave:

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
date (1081211) - CYYMMDD             time (072412) HH-MM-SS
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL BUILD=(C'Tdate,''',7,7,C'''',80:X,/,
                C'Ttime,''',44,6,C'''')
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
 SORT FIELDS=(51,11,CH,A)
 INCLUDE COND=(39,4,PD,GE,       ,AND,43,4,PD,GT,      ,
 AND,438,3,CH,EQ,C'146',AND,717,9,CH,NE,C' ')
/*
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(2,7,CH,EQ,C'INCLUDE'),
    OVERLAY=(27:Tdate,50:Ttime))
/*
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sat Dec 13, 2008 12:32 pm
Reply with quote

Frank,

AFAIK, Here the first step produces Symbols like this,
Code:
Tdate,'cyymmdd'
Ttime,'hhmmss'
Since the final comparison is done against a numeric PD field, wont this quotes around the date and time values be a problem? Should n't this be something like this?
Code:
Tdate,+cyymmdd
Ttime,+hhmmss
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: Sat Dec 13, 2008 9:43 pm
Reply with quote

No, it works fine as coded. I used:

Code:

   OVERLAY=(27:Tdate,50:Ttime))


This overlays the blanks in the INCLUDE statement with the character constants - it does not use the symbols to do the compare.

If you run the job, you'll see that the resulting statements are:

Code:

 SORT FIELDS=(51,11,CH,A)                                 
 INCLUDE COND=(39,4,PD,GE,1081211,AND,43,4,PD,GT,072412,   
 AND,438,3,CH,EQ,C'146',AND,717,9,CH,NE,C' ')             
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sun Dec 14, 2008 11:54 am
Reply with quote

Frank,

I got it. I was just comparing this with my solution. Did not notice that you were not doing the comparison. icon_mad.gif Thank you
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 Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top