View previous topic :: View next topic
|
Author |
Message |
hnharish
New User
Joined: 30 Aug 2005 Posts: 23
|
|
|
|
Hello All,
Could you please provide me a sample code to create flat file dynamically in REXX.
Thanks,
Harish. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
No.
I leave it to you to search the forum
and even google,
to find the answer. |
|
Back to top |
|
|
hnharish
New User
Joined: 30 Aug 2005 Posts: 23
|
|
|
|
Hello,
I have already done searching for sample code in google and found the below code but it is not creating file.
ALLOCDS:
FILENAME = "ABC.FEP."||PGMNAME||".SEQ"
"ALLOCATE DATASET('"FILENAME"') NEW SPACE(5,1) DSORG(PS) RECFM(F)",
"LRECL(80) BLKSIZE(800)"
IF RC > 0 THEN DO
SAY "ERROR " RC " FAILURE TO ALLOCATE DATASET " FILENAME
EXIT 8
END
RETURN
Thanks,
Harish |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
So what happens when you run the code? Do you get any messages? What does the message say? How about running the code with the trace on? |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
The allocated command specified above,
Code: |
"ALLOCATE DATASET('"FILENAME"') NEW SPACE(5,1) DSORG(PS) RECFM(F)",
"LRECL(80) BLKSIZE(800)" |
works fine. Exact error message would be useful in helping you find a solution than "but it is not creating file. " |
|
Back to top |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
The sample you provided is absolutely correct.
Creating a flat file means two things:
- Use the NEW parameter on the ALLOC statement together with all necessary data set attributes
- Use PS as data set organization
What went wrong when you run the program?
Post your full code together with the output to let somebody check what had happened. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Follow on ...
the situation is a bit murky
some investigation has to be done
i' ll post in a while the results |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Quote: |
RECFM(F) LRECL(80) BLKSIZE(800)
|
I guess it has to be : RECFM(F B) |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
as i said the situation is very murky
I was tempted to post as my first comment ...
You dummy , NEW ok but after that aren' t You missing something,
by I was in a wisdom moment and ...
the manual tells
Quote: |
If you specify a data set name, a NEW data set is kept and cataloged. If you do not specify a data set name, it is deleted when you free it or log off. |
but that holds only when using the TSO allocate
when using the BPXWDYN interface, things behave in a different way ,
the dataset gets delete afterwards
also I noticed that using TSO allocate the datasets gets allocated to a STORAGE volume
when using BPXWDYIN it gets allocated to a PUBLIC volume
anyway it is always better to use all the logic parameters and not let them default
and remember, when using BPXWDYN the KEYWORDS AND THE SYNTAX ARE <DIFFERENT> from the tso ALLOC |
|
Back to top |
|
|
hnharish
New User
Joined: 30 Aug 2005 Posts: 23
|
|
|
|
Hello,
I am using the pgm PGM=IRXJCL, that is the reason the file is not getting created.
Could you please tell me how to create the file using the above program.
Thanks,
Harish |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
I am using the pgm PGM=IRXJCL, that is the reason the file is not getting created. |
for what effing reason why didn ' t You post that info from the beginning instead of having people wasting time to test and research to help You ?
do You have a doctor' s prescription to use irxjcl !
search the forums and read the manuals
no reason for anybody to waste time on badly asked questions
and above all learn how to post properly
to make the most out of the questions You ask and to forecast the comments You might receive
it would be wise for You to read and meditate on
how to ask questions the smart way
here catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here support.microsoft.com/kb/555375 |
|
Back to top |
|
|
hnharish
New User
Joined: 30 Aug 2005 Posts: 23
|
|
|
|
enrico-sorichetti wrote: |
Quote: |
I am using the pgm PGM=IRXJCL, that is the reason the file is not getting created. |
for what effing reason why didn ' t You post that info from the beginning instead of having people wasting time to test and research to help You ?
do You have a doctor' s prescription to use irxjcl !
search the forums and read the manuals
no reason for anybody to waste time on badly asked questions
and above all learn how to post properly
to make the most out of the questions You ask and to forecast the comments You might receive
it would be wise for You to read and meditate on
how to ask questions the smart way
here catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here support.microsoft.com/kb/555375 |
I am not a REXX expert. I am still in a learning stage. I was doing some more research on the above issue and came to know that the above code does not work with irxjcl pgm.I have implemented most of the REXX code with irxjcl pgm hence thought the above code will also work.
I have some questions to you.
Why didn't this question came into u r mind?
You would have asked this question to me earlier itself.right? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
I have some questions to you.
Why didn't this question came into u r mind?
You would have asked this question to me earlier itself.right? |
as usual like spoiled kids who expect everything and giving nothing
You are just trying to blame me for Your incompetence |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
oh boy, the politically correct stand tall.
the fault aways lies with someone else.
hnharish,
how much help do you think you are going to receive now? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Hi Dick,
in this case it' my usual dumbness that made think about people having done a bitsy bit of homework and due diligence in telling
for the TS
the usual assumption is that the REXX has been run under IKJEFTxx so it is Your duty to tell otherwise from the beginning if it is not so |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
hnharish wrote: |
I am not a REXX expert. I am still in a learning stage. |
You are not an expert in anything, Sunny Jim, else you'd know that ALLOCATE is a TSO command, not a Rexx statement or function, and that IKJEFTxx is background TSO, whilst IRXJCL is the Rexx batch interpreter.
I see that you've been a member of this site for six years, but claim no mainframe skills. That, to my mind, is entirely correct |
|
Back to top |
|
|
|