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
 

 

Dealing with FB and VB file in a single module

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Ravi Kuchi

New User


Joined: 29 May 2012
Posts: 14
Location: INDIA

PostPosted: Thu Jul 19, 2012 4:30 pm    Post subject: Dealing with FB and VB file in a single module
Reply with quote

Hi Friends,

Is there a possibility to write an assembler module that could open a file (it could be either FB or VB) and check if it is empty or not ?
or else
do we need to have seperate modules for each of these kind?

Thanks!
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Jul 19, 2012 4:38 pm    Post subject:
Reply with quote

posting a question on an internet forum is RESEARCHING?

in addition to being either FB or VB, is the DSN (Dataset Name) known at run-time,
or is this dynamic?

also, do you differentiate between allocated
and allocated/opened/closed
when you mean empty?

IF the DSN is known at run-time, there are plenty of threads in the
DFSORT forum (as well as the JCL forum - syncsort as well as IBM utilities)
that deal with this question
that you could research.

So is this a question about Assembler
or the function of determining if a file is empty?
Back to top
View user's profile Send private message
Ravi Kuchi

New User


Joined: 29 May 2012
Posts: 14
Location: INDIA

PostPosted: Thu Jul 19, 2012 4:57 pm    Post subject: Reply to: Dealing with FB and VB file in a single module
Reply with quote

Yes, The DSN name is known at run time.

Let me explain the assembler module we are trying to build.

1) The module should open the file.
2) If the file open is succesful, then it would try to read the first record.
3) If the file open is not successful then it should return with return-code 8
4) If a record is present then it should close the file and exit with return code of 4
5) If the file is empty then it should exit with return code of Zero.

Hope, I am clear.

Thanks
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 Jul 19, 2012 9:25 pm    Post subject:
Reply with quote

Hello,

It is still not clear to me if the goal is the process to determine if the file is empty or the goal is just to write some assembler icon_confused.gif

What does "open not successful" mean? If the file does not exist, it cannot be opened and if named in the JCL will cause a jcl error before the code is even running.

As DBZ mentioned, look in the sort and jcl parts of the forum as there are several topics dealing with detecting an empty file.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Jul 19, 2012 10:29 pm    Post subject: Reply to: Dealing with FB and VB file in a single module
Reply with quote

If you issue an IDCAMS PRINT COUNT(0) and the RC=04, then the file is empty. COUNT(0) prevents records from being printed as their contents might not be for non-authorized eyes. Management likes precautions like this.... icon_wink.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Fri Jul 20, 2012 1:48 pm    Post subject:
Reply with quote

Quote:

If you issue an IDCAMS PRINT COUNT(0) and the RC=04, then the file is empty.


Really Bill ?


Code:

IDCAMS  SYSTEM SERVICES                                           TIME:


08:47:20        07/20/12     PAGE   1


 REPRO IFILE(DUMMY) OFILE(OUTPUT)

IDC0005I NUMBER OF RECORDS PROCESSED WAS 0

IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0


 PRINT IFILE(OUTPUT) COUNT(0)

IDCAMS  SYSTEM SERVICES                                           TIME: 08:47:20        07/20/12     PAGE   2


LISTING OF DATA SET -SYS12202.T084720.RA000.XIBFIDC.R0000001

IDC0005I NUMBER OF RECORDS PROCESSED WAS 0

IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0

IDCAMS  SYSTEM SERVICES                                           TIME: 08:47:20        07/20/12     PAGE   3




IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Jul 20, 2012 2:13 pm    Post subject:
Reply with quote

It's Friday Peter, go slow...icon_smile.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Fri Jul 20, 2012 2:23 pm    Post subject:
Reply with quote

Anuj, just saying have a nice week-end.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Fri Jul 20, 2012 2:38 pm    Post subject:
Reply with quote

Well the strange thing is :

with a PRINT of
COUNT(0) will give a max cond code of 0
COUNT(1) will give a max cond code of 4

with a repro of the empty file to another dummy dataset :

without COUNT will give a max cond code of 0
with COUNT(1) will give a max cond code of 4
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: Fri Jul 20, 2012 6:48 pm    Post subject:
Reply with quote

Hello,

Well, it "successfully" processed zero records . . . hence the cc zero?
And unsuccessfully processes one record - so the cc 4?

The successful count of zero records varified the existence of the file (which would have caused a jcl error if it did not exist)?

Yup, kinda strange. . .
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Jul 20, 2012 9:00 pm    Post subject: Reply to: Dealing with FB and VB file in a single module
Reply with quote

Peter,

COUNT(1) is the correct choice, returning an RC=04 for an empty file.

I've used this for many years. But, as CRS kicks in icon_sad.gif , I may have been thinking of a VSE environment, where COUNT("whatever") returns an RC=04 for an empty file.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Sat Jul 21, 2012 12:23 am    Post subject:
Reply with quote

Hallo Bill,

with all respect, i was just doing some tests with that idcams stuff. And did you mean with CRS this ? :

http://crs.org/
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Jul 21, 2012 1:20 am    Post subject: Reply to: Dealing with FB and VB file in a single module
Reply with quote

Hi Peter,

Actually, CRS is correct (Can't Remember Sh*t).

icon_lol.gif icon_lol.gif icon_lol.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 -> PL/I & Assembler 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 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
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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