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
 

 

Printing previous date and blank rows

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

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Thu Sep 26, 2013 5:33 pm    Post subject: Printing previous date and blank rows
Reply with quote

I want to print name of previous month like "Sep 2013" if job run on 1st of October,in my header.
Also i want two blanks rows after my first header,i am already using two headers and two trailer.
Back to top
View user's profile Send private message

vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Sep 26, 2013 5:57 pm    Post subject:
Reply with quote

Hello,
Pls post

the input file layout,
expected output file sample,
input & output file dataset attributes.
the name of the sort product that you have.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Thu Sep 26, 2013 7:21 pm    Post subject:
Reply with quote

I am using DFSORT

This job will run on 1st of every month.I am already done with the report preparation i just stuck with the header part.I want to print month name and year like "sep 2013" somewhere in header.So my heading will look like below

"Mailbox for EFT transaction on us (&prev-month current year)"

Please advise what keywords shall i use to do this.
Also i want two blank rows after the header to make the report more readable.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Sep 26, 2013 9:08 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

You will get to what you want more quickly if you post all of the info requested. . .

Please post a sample of your output so far and an example what you want. I believe we understand, but it is so much easier to see with an example.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Oct 01, 2013 1:23 am    Post subject:
Reply with quote

trushant.w,

Use the following. It doesn't matter when you run the job, you will always get the last month.

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                 
                                                                 
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  INREC IFOUTLEN=80,IFTHEN=(WHEN=INIT,BUILD=(DATE2-1,80:X)),     
  IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=5,                         
   INOUT=(C'01',C'JAN',C'02',C'FEB',C'03',C'MAR',C'04',C'APR',   
          C'05',C'MAY',C'06',C'JUN',C'07',C'JUL',C'08',C'AUG',   
          C'09',C'SEP',C'10',C'OCT',C'11',C'NOV',C'12',C'DEC')))
                                                                 
  OUTFIL REMOVECC,NODETAIL,                                     
  HEADER1=('MAILBOX FOR EFT TRANSACTION ON US ',5,3,X,1,4,/,/)   
//*                                                             
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Oct 01, 2013 5:23 pm    Post subject:
Reply with quote

Hi Skolusu

Thanks for reply!!

But it looks like as i am already using the build function for other calulations this is not getting proper result.
I am unable to print like"Sep 2013" also my other calculation also getting effected.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Oct 01, 2013 5:39 pm    Post subject: Reply to: Printing previous date and blank rows
Reply with quote

Kolusu has shown you how to turn a file containing a single blank line into the date that you require.

Neither he nor anyone else is looking over your shoulder to see what other code you have.

You are expected to take the working code provided by Kolusu and apply it to your code.

You will need to append (fixed-length data) or prepend (variable-length data) the formatted date to each record.

Firstly, fully understand Kolusu's code.

Secondly, apply it to your existing code so that it causes no upsets.

If you have problems, post your code, sample input, oiutput produced by the sample and output expected.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Tue Oct 01, 2013 6:44 pm    Post subject:
Reply with quote

Quote:
But it looks like as i am already using the build function for other calulations this is not getting proper result.
I am unable to print like"Sep 2013" also my other calculation also getting effected.

Hello,
How do you expect us to give you a solution that matches your requirement, unless you share what you have tried, input, output record structure?
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Oct 01, 2013 8:19 pm    Post subject:
Reply with quote

I am using below code

Code:
 INREC IFTHEN=(WHEN=(20,11,ZD,LT,500000000),                         
   BUILD=(20,11,12:3X,15:C'1',16:4X,11C'0',31:4X,35:C'0',36:2X,       
          38:DATE2-1)),FINDREP=(STARTPOS=42,                           
    INOUT=(C'01',C'JAN',C'02',C'FEB',C'03',C'MAR',C'04',C'APR',       
           C'05',C'MAY',C'06',C'JUN',C'07',C'JUL',C'08',C'AUG',       
           C'09',C'SEP',C'10',C'OCT',C'11',C'NOV',C'12',C'DEC'))),     
*                                                                     
  IFTHEN=(WHEN=NONE,                                                   
      BUILD=(11C'0',12:3X,1C'0',16:4X,20:20,11,31:4X,35:C'1',36:2X,   
      38:DATE2-1)),                                         



but i am getting below error
Code:

ICE107A F DUPLICATE, CONFLICTING, OR MISSING INREC OR OUTREC STATEMENT OPERANDS
             INOUT=(C'01',C'JAN',C'02',C'FEB',C'03',C'MAR',C'04',C'APR',     
             $


Code'd
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Oct 01, 2013 9:47 pm    Post subject: Reply to: Printing previous date and blank rows
Reply with quote

You can't have more than one function on a single IFTHEN. So you can't have BUILD and FINDREP on the same IFTHEN,

If you look at Kolusu's example, he has one WHEN=INIT store the date and another WHEN=INIT to do the FINDREP.

Why don't you use that approach to extend your input records with the date attached to the end of the record, and then specify that position for your date when you do the BUILDs later?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Oct 01, 2013 10:25 pm    Post subject: Reply to: Printing previous date and blank rows
Reply with quote

trushant.w,

Use the following code.

Code:
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=(20,11,ZD,LT,500000000),                       
     BUILD=(20,11,12:3X,15:C'1',16:4X,11C'0',31:4X,35:C'0',36:2X)),
  IFTHEN=(WHEN=NONE,                                               
     BUILD=(11C'0',12:3X,1C'0',16:4X,20:20,11,31:4X,35:C'1',36:2X))
                                                                   
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(38:DATE2-1,2X)),               
  IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=42,                           
      INOUT=(C'01',C'JAN',C'02',C'FEB',C'03',C'MAR',C'04',C'APR',   
             C'05',C'MAY',C'06',C'JUN',C'07',C'JUL',C'08',C'AUG',   
             C'09',C'SEP',C'10',C'OCT',C'11',C'NOV',C'12',C'DEC')))
                                                                   
  OUTFIL REMOVECC,BUILD=(1,37,80:X),                               
  HEADER1=('MAILBOX FOR EFT TRANSACTION ON US ',42,3,X,38,4,/,/)   
//*
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Thu Oct 03, 2013 8:15 pm    Post subject:
Reply with quote

Thank you very much Skolusu.... icon_biggrin.gif
Thanks for your input Bill.
I am now getting the exact report.

But i am unable to understand the significance of BUILD in OUTFIL
I tried without that BUILD in OUTFIL but its not working
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Oct 03, 2013 8:39 pm    Post subject: Reply to: Printing previous date and blank rows
Reply with quote

Well, what it does when you take the BUILD off (and assuming you took off the comma on the previous line) is a very big clue to the reason for having it.

So, what output do you get when you take off the BUILD? Can you work out what those unexpected things are and relate it to the earlier code in the Control Cards?
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
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to get previous month in SYMNAMES Suganya87 SYNCSORT 9 Fri Oct 28, 2016 1:37 pm
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm


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