开发者

How to filter out the data by date using DFSORT

开发者 https://www.devze.com 2023-03-25 12:11 出处:网络
I have a flat file with some useful data along with timestamp on each record. Inorder to create a report, I need data of last month ONLY for my further analysis. With out using a cobol source code, RE

I have a flat file with some useful data along with timestamp on each record. Inorder to create a report, I need data of last month ONLY for my further analysis. With out using a cobol source code, REXX EXECs I need to filter out last month's data using DFSORT. Hope my question is clear.

开发者_如何学C

Note: I use JOBTRAC scheduler. Using JOBTRAC parameters, I can dynamically allocate values and filter out data, but dont want to make use of them.


Here is a possible answer:

//STEP01  EXEC PGM=SORT,REGION=0M
//SYSOUT    DD SYSOUT=*
//SORTIN    DD DSN=INPUT.DATASET,DISP=SHR
//SORTOUT   DD DSN=OUTPUT.DATASET,DISP=NEW
//SYSIN     DD *
   INCLUDE COND=(001,007,EQ,DATE2(-)-1)
/*

I have assumed the following things:

  1. The timestamp starts at position one
  2. The timestamp is an alphanumeric
  3. The timestamp starts with YYYY-MM-DD
  4. "Last month" is the month previous to the current one
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号