Build a NDM Control card, which has the Output receiving filename in the below format:
APPL_CD_YYYYMMDD_nnnnn(...?).txt
APPL_CD - a Constant
YYYYMMDD - Asofdate - obtained from a Date VSAM file.
nnnnn(...?) - varies depending on the number of records in the Input Extract file.
For Example. assuming the AsOfDate to be 30 June 2013, and the Count of the Input file is 5000, the format of the file would look like
Ok, now , i am building this Control card using ICETOOL. The Variables here are the DATE and the Count. I started building the filename just for the COUNT for now (not worrying about the Date part) - using the COUNT feature and COPY feature to arrive at APPL_CD_000000152.txt
But the requirement is to get the filename as APPL_CD_152.txt (Ofcourse, i plan to add the Date part later - once i figure out how to get the Zeroes suppressed!)
What should i do to Suppress the Zeroes?
I do NOT remember the exact Code right now - maybe if needed i can provide when i get to office ... From what i remember...it looks something like below..
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
rsuresh100 wrote:
Ok, now , i am building this Control card using ICETOOL. The Variables here are the DATE and the Count. I started building the filename just for the COUNT for now (not worrying about the Date part) - using the COUNT feature and COPY feature to arrive at APPL_CD_000000152.txt
But the requirement is to get the filename as APPL_CD_152.txt (Ofcourse, i plan to add the Date part later - once i figure out how to get the Zeroes suppressed!)
What should i do to Suppress the Zeroes?
I do NOT remember the exact Code right now - maybe if needed i can provide when i get to office ... From what i remember...it looks something like below..
You don't need two passes to get the count with leading zeroes suppressed. The date you are getting is also from the same file that you want to find the count of records or is it a different file? How do you identify the date from vsam file? Is it on every record or just the header or ?
Thanks for the response kolusu. The date is from a different file altogether from the other input extract file - it is a VSAM file with Unique records for different applications which forms the key. I would be picking the date from that file based on my Application key say, APPL_CD and pick the Asofdate say from position 11, a length of 8 bytes.
I would appreciate if you can let me know how you can get a count with leading zeroes suppressed and still append to the file in a single pass.
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
Have you considered using the code tags to preserve the spacing in your posts. You have been here long enough to know how to use them and why you need to use them.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Suresh,
You can use the below syncsort to achieve this. Here the first step creates a symbol 'CNT1' for the record count and the second step just substitutes the count in place of the dummy count text - '$$$' in the input NDM template card.