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
 

 

Dynamically create flat file in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
hnharish

New User


Joined: 30 Aug 2005
Posts: 22

PostPosted: Mon Sep 26, 2011 11:43 am    Post subject: Dynamically create flat file in REXX
Reply with quote

Hello All,

Could you please provide me a sample code to create flat file dynamically in REXX.

Thanks,
Harish.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Sep 26, 2011 11:45 am    Post subject:
Reply with quote

No.

I leave it to you to search the forum
and even google,
to find the answer.
Back to top
View user's profile Send private message
hnharish

New User


Joined: 30 Aug 2005
Posts: 22

PostPosted: Mon Sep 26, 2011 12:08 pm    Post subject: Reply to: Dynamically create flat file in REXX
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon Sep 26, 2011 12:15 pm    Post subject: Reply to: Dynamically create flat file in REXX
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Mon Sep 26, 2011 12:18 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Mon Sep 26, 2011 12:37 pm    Post subject: Re: Dynamically create flat file in REXX
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Sep 26, 2011 12:44 pm    Post subject: Reply to: Dynamically create flat file in REXX
Reply with quote

I just got curious and run a simple tests...
looks like TSO allocate is buggy ...
it should not let allocate with recfm F (fixed) and mismatching lrecl-blksize
the first thing to do would be to change RECFM(F) to RECFM(F B)

it allocates it... it allocates it, but it will be unusable
when trying to edit it ISPF fails reporting a lrecl/blksize mismatch for F format datasets

i thought initially about commenting ...
the manuals has the answer ... starting from here
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IKJ4BK90
not the latest ones but more than enough to solve this simple problem
if You are lazy or unable to find the relevant pages here is the direct link to the relevant pages
for the manual
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4C590/CCONTENTS?SHELF=IKJ4BK90&DN=SA22-7782-10&DT=20080523031459
for the allocate command
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4C590/1.7?SHELF=IKJ4BK90&DT=20080523031459

but, since it looks like the TS is providing completely wrong info
the only advice is to look better to what is happening
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Sep 26, 2011 1:24 pm    Post subject: Reply to: Dynamically create flat file in REXX
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Sep 26, 2011 1:29 pm    Post subject:
Reply with quote

Quote:

RECFM(F) LRECL(80) BLKSIZE(800)


I guess it has to be : RECFM(F B)
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Sep 26, 2011 1:55 pm    Post subject: Reply to: Dynamically create flat file in REXX
Reply with quote

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
View user's profile Send private message
hnharish

New User


Joined: 30 Aug 2005
Posts: 22

PostPosted: Mon Sep 26, 2011 2:35 pm    Post subject: Reply to: Dynamically create flat file in REXX
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Sep 26, 2011 2:41 pm    Post subject: Reply to: Dynamically create flat file in REXX
Reply with quote

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 icon_evil.gif

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 http://catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here http://support.microsoft.com/kb/555375
Back to top
View user's profile Send private message
hnharish

New User


Joined: 30 Aug 2005
Posts: 22

PostPosted: Mon Sep 26, 2011 4:49 pm    Post subject: Re: Reply to: Dynamically create flat file in REXX
Reply with quote

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 icon_evil.gif

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 http://catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here http://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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Sep 26, 2011 4:52 pm    Post subject: Reply to: Dynamically create flat file in REXX
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Sep 26, 2011 4:55 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Mon Sep 26, 2011 5:02 pm    Post subject: Reply to: Dynamically create flat file in REXX
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Mon Sep 26, 2011 6:46 pm    Post subject: Re: Reply to: Dynamically create flat file in REXX
Reply with quote

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 icon_razz.gif
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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