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

Perform airthmetic operations in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jithumohan

New User


Joined: 31 Jan 2008
Posts: 30
Location: Woodland Hills, CA

PostPosted: Fri Mar 15, 2013 12:06 am
Reply with quote

Hi,

I need to check following condition on each record in a mainframe flat file and write only records which satisfies this condition. Can anyone let me know the sort card for achieving this?

Date1 (in CCYY-MM-DD format) - system date (in CCYY-MM-DD format) <= field2 (days).
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Mar 15, 2013 1:52 am
Reply with quote

jithumohan wrote:
Hi,

I need to check following condition on each record in a mainframe flat file and write only records which satisfies this condition. Can anyone let me know the sort card for achieving this?

Date1 (in CCYY-MM-DD format) - system date (in CCYY-MM-DD format) <= field2 (days).


1. What is the LRECL and RECFM of the input file?
2. What is the Position of the Date field?
3. What is the position and format of Filed2 which has the days?
4. Last but not least run the following job and show me the complete sysout which helps us determine the level of DFSORT you have.

Code:

//STEP0100 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD *             
//SORTOUT  DD SYSOUT=*     
//SYSIN    DD *             
  OPTION COPY               
//*
Back to top
View user's profile Send private message
jithumohan

New User


Joined: 31 Jan 2008
Posts: 30
Location: Woodland Hills, CA

PostPosted: Fri Mar 15, 2013 4:10 am
Reply with quote

Here is the sort card I am using.

SORT FIELDS=COPY
INREC IFOUTLEN=450,IFTHEN=(WHEN=INIT,
OVERLAY=(451:DATE1,360,10,UFF,M10,LENGTH=8,
467:459,8,Y4T,DATEDIFF,451,8,Y4T))
OUTFIL INCLUDE=(467,3,ZD,LE,369,3,ZD)

450 is the record length, RECFM=FB.
Date1 is at position 360
field2 is at position 369

But I am getting syntax error in 467:459,8,Y4T,DATEDIFF,451,8,Y4T))
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Mar 15, 2013 9:50 am
Reply with quote

Quote:
But I am getting syntax error in 467:459,8,Y4T,DATEDIFF,451,8,Y4T))
You also need to execute the code Skolusu show, please do so and post the SYSOUT here.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Mar 16, 2013 12:58 am
Reply with quote

jithumohan wrote:
But I am getting syntax error in 467:459,8,Y4T,DATEDIFF,451,8,Y4T))


Well I am guessing that you are using syncsort, which does not support Y4T, so if you indeed using syncsort then please post your questions in the JCL forum.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Use of Perform Thru Exit COBOL Programming 6
No new posts how to do bit operations from CHAR PL/I & Assembler 3
No new posts RFE: Additional compound operators fo... PL/I & Assembler 1
No new posts FileAid to compare(logical operations... Compuware & Other Tools 3
No new posts How to perform Digest Access Authenti... All Other Mainframe Topics 0
Search our Forums:

Back to Top