How to get the file name?

Other Mainframe related questions which attracts you and there is no suitable Forum you find for it and related FAQs.
Post Reply
Kapil Sharma
Registered Member
Posts: 52
Joined: Sun Sep 29, 2013 1:46 am
Location: India

How to get the file name?

Post by Kapil Sharma »

Hi,

For a requirement another system will be sending files to a FTP server every 15 minutes. We need to pick up the files from that server to be processed on mainframes.

The file name will be an ASN number along with timestamp. I need to use ASN number in my processing but the ASN number is part of the file name and not the content of it. So if I GET using FTP the file, how do I know the ASN number?

Would getting the files on GDG every 15 minutes on mainframes be good or should I receive the file once in a day, which is end of the day?
Thanks,
Kapil
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: How to get the file name?

Post by Robert Sample »

You did not really describe enough for a complete answer. For example,
I need to use ASN number in my processing
which language is this processing being done in -- C? C++? Perl? Java? COBOL? REXX? The language choice is important. If you need the ASN as part of the file name, then you don't really want to FTP directly to a GDG -- or if you do, you will want to post-process the FTP output to find the ASN in the FTP messages output. If you don't send to a GDG, does the ASN you're using meet mainframe data set name standards (1 to 8 characters starting with a letter or specific symbol)? You may want to send the file to a Unix directory, which has fewer restrictions on naming, and as part of your processing copy the data to a GDG (perhaps with a header containing the ASN?) for archival purposes.
Would getting the files on GDG every 15 minutes on mainframes be good or should I receive the file once in a day, which is end of the day?
We cannot even begin to answer this -- it depends upon the application's requirements. Does the application expect the data to be processed during the day or only once a day? How often does the server generate the ASN files -- every few minutes? every twelve hours? once a week? The frequency of generation should impact how often the data is sent. And rather than pulling the data with an FTP GET, have you considered using a PUT on the other side to move the file to the mainframe?

It sounds like someone (you or whoever) needs to sit down and design a solid process before you go any further. Good design alleviates many issues, while bad design exacerbates many issues.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: How to get the file name?

Post by enrico-sorichetti »

if the network connections are reliable one solution to investigate could be ...

send to the master site a list of files ready to be received

the file name could be fixed so that the job scheduler ( TWS or similar ) could intercept the creation of it
and schedule a job to process the list to get the listed files
used the same logoc even if in a different environment
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: How to get the file name?

Post by enrico-sorichetti »

what in hell is an ASN number
do not use Your organisation jargon, we do not care about it :twisted:

here are a few acronyms to choose from
ASN American Society of Nephrology
ASN Abstract Syntax Notation
ASN Autonomous System Number
ASN Asian
ASN Asparagine
ASN Assistant Secretary of the Navy
ASN Aviation Safety Network
ASN Autorité de Sûreté Nucléaire (French: Nuclear Safety Authority)
ASN Associate of Science In Nursing
ASN American Society for Nutrition (Bethesda, MD)
ASN Aswan (Egyptian automobile license plate)
ASN American Society for Neurochemistry (Windermere, FL)
ASN Advance Ship Notices
ASN Adobe Solutions Network
ASN Average Sample Number
ASN Advanced Shipment Notification
ASN American Society of Neuroimaging (Minneapolis, MN)
ASN American Society of Naturalists
ASN Augmented Social Network
ASN Access Stack Node (Baystream)
ASN Atlantic Satellite Network
ASN Autorite Sportive Nationale (French: National Sporting Association)
ASN Access Service Node
ASN Acquired Situational Narcissism (psychology)
ASN Additional Student Numbers (UK)
ASN Allotment Serial Number
ASN Assigned Serial Number
ASN Australian Science Network
ASN Artificial Social Network
ASN ATM Switching Network (Siemens/Stromberg-Carlson)
ASN Auxiliary Signal Network (Cisco)
ASN AT&T Switched Network
ASN Army Service Number
ASN Active Sensor Network
ASN AIDS Support Network of San Luis Obispo County
ASN Abstract Symbol Notation
ASN Atomic Strike Net
ASN Assigned Sequence Number
ASN Autonomous and Spontaneous Networks (Symposium)
ASN American Switching Network
ASN Avionics Systems Network
ASN Advanced Shipment/Shipping Notice
ASN Association Sahel Nature (Burkina Faso)
ASN Access Stack Note (Wescon)
ASN Automated Surveillance Network
ASN A Sweet Niche (band)
ASN Ad-Hoc Secondary Network (wireless communications)
ASN Aerospatiale Norme (Romanian: Aerospace Standards)
ASN African Solution Network (Bronx, NY)
ASN Amazon Stock Number (Amazon)
ASN Axon-Schwann Cell Network
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Kapil Sharma
Registered Member
Posts: 52
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Re: How to get the file name?

Post by Kapil Sharma »

Robert Sample wrote: Tue Aug 21, 2018 8:55 pmwhich language is this processing being done in -- C? C++? Perl? Java? COBOL? REXX?
It is going to be COBOL.

There is a Windows Server, where the file is sent across. I can either FTP GET those files one by one as and when they arrive or as a single file at the end of the day. GET would put them on mainframe.
Thanks,
Kapil
Kapil Sharma
Registered Member
Posts: 52
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Re: How to get the file name?

Post by Kapil Sharma »

enrico-sorichetti wrote: Tue Aug 21, 2018 9:12 pmwhat in hell is an ASN number
It means Advance Shipment Notification but it can be any number. Sorry for the confusion.
Thanks,
Kapil
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: How to get the file name?

Post by nicc »

You need to do more processing on the windows side: add the ASN to the header (there IS a header, right?), add it to the the trailer (there IS a trailer, right?) write the output of that process to a fixed filename and send it to the mainframe. The mainframe scheduler can then detect the arrival of the data set and kick off the mainframe process which should include backing up to a GDG and deletion of the received data set. How often you get the data is irrelevant for this process.
Regards
Nic
Kapil Sharma
Registered Member
Posts: 52
Joined: Sun Sep 29, 2013 1:46 am
Location: India

Re: How to get the file name?

Post by Kapil Sharma »

nicc wrote: Mon Sep 03, 2018 2:34 pmYou need to do more processing on the windows side: add the ASN to the header (there IS a header, right?), add it to the the trailer (there IS a trailer, right?) write the output of that process to a fixed filename and send it to the mainframe. The mainframe scheduler can then detect the arrival of the data set and kick off the mainframe process which should include backing up to a GDG and deletion of the received data set. How often you get the data is irrelevant for this process.
Thanks. I've also asked them to provide the name of the file in the content itself. Waiting for the requestor information.
Thanks,
Kapil
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: How to get the file name?

Post by nicc »

If you use a fixed filename then there is no point in having it in hthe data - and if it is in the data and the filename is variable you still need to find out the filename by some other means. You need to keep it as simple as possible: a fixed filename that can be FTPed to the mainframe - probably to a fixed data set name which can the be copied to a +1 GDG. Ding it this way means nothing has to be changed in production for each run and if the FTP fails you will not have to delete the GDG as it will not be created until the FTP is successful.
Regards
Nic
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Other Mainframe Topics, Off-Topics, FAQs.”