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
 

 

How to define Undefined records in Assembelr
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
sakrish

New User


Joined: 05 Nov 2008
Posts: 21
Location: chennai

PostPosted: Thu Nov 06, 2008 12:53 pm    Post subject: How to define Undefined records in Assembelr
Reply with quote

Hi guys

I want read af file whose RECFM=U.

Can some one tell how can we define it in assembler
what are its DCB parameters.

its a huge file with Blksize=32004

please do help .

Thanks in advance
-sai
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Nov 06, 2008 8:17 pm    Post subject:
Reply with quote

Code:
TESTDCB  DCB   DDNAME=SYSTEST,BLKSIZE=32004,DSORG=PS,RECFM=U,MACRF=(GM)
assembles without any messages for me.
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Thu Nov 06, 2008 8:34 pm    Post subject:
Reply with quote

As you have stated, the DCB parms are RECFM=U,BLKSIZE=32004.

When you read a record, there will be a value in the DCB area for the actual length read on this record. Your pgm must be smart enough to know how to distinguish record types and what to do with them.

I would recommend checking the GET macro in the DFSMS manual "Macro Instructions for Datasets" for tips on how to do this.
Back to top
View user's profile Send private message
sakrish

New User


Joined: 05 Nov 2008
Posts: 21
Location: chennai

PostPosted: Fri Nov 07, 2008 7:35 am    Post subject: Reply to: How to define Undefined records in Assembelr
Reply with quote

Thanks guys,

My doubt is when defining a record for that file

TESTRECD DS 0CL32004
will work or not.

Can Assembler handle this much length of records ?


-Sai
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 Nov 07, 2008 7:55 am    Post subject:
Reply with quote

Hello,

From a fairly recent Assembler reference manual:
Quote:
Unlike the DC instruction, the DS instruction causes no data to be assembled. Therefore, you do not have to specify the nominal value (fourth subfield) of a DS instruction operand. The DS instruction is the best way of symbolically defining storage for work areas, input/output buffers, etc.

Although the formats are identical, there are two differences in the specification of subfields. They are:

The nominal value subfield is optional in a DS operand, but it is mandatory in a DC operand. If a nominal value is specified in a DS operand, it must be valid.

The maximum length that can be specified for the character (C) and hexadecimal (X) type areas is 65,535 bytes rather than 256 bytes for the same DC operands. The maximum length for the graphic (G) type is 65,534 bytes.
Back to top
View user's profile Send private message
sakrish

New User


Joined: 05 Nov 2008
Posts: 21
Location: chennai

PostPosted: Fri Nov 07, 2008 11:10 am    Post subject: Reply to: How to define Undefined records in Assembelr
Reply with quote

Thanks again, my code is active now

But in my JCL, i am getting SOC 04 error

MY program has input file name as INFILE and output file name as OUTFILE

and JCL DD names are INFILE1 and OUTFILE1


Code:
*******************************************                             
*            Analysis of Error            *                             
*******************************************                             
                                                                         
The system completion code of 0C4 is issued when the program attempts to
use storage that is not accessible.                                     
                                                                         
                                                                         
*** List of Probable 0C4 Causes ***                                     
                                                                         
1.  Missing or incorrect DD statement -                                 
    Check system messages from abending step.                           
                                                                         
2.  Tried to read or write an unopened file.                             
                                                                         
3.  Tried to reference record area before file opened.                   
                                                                         
4.  Indexing or subscripting outside defined limits.                     


I think may be 4th one is causing me to get SOC4


Can some one guide me what may be wrong ?

Thanks in advance
-Sai
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 Nov 07, 2008 11:56 am    Post subject:
Reply with quote

Hello,

Quote:
Can some one guide me what may be wrong ?
Not from what you have posted. . .

For us to be able to help, we need something to work with.

How much assembler have you written before this program? How large is this program? Suggest you put bits of diagnostic code in your program to determine where it abends. Once you know where it abends, it should be easier to fix it.
Back to top
View user's profile Send private message
sakrish

New User


Joined: 05 Nov 2008
Posts: 21
Location: chennai

PostPosted: Sat Nov 08, 2008 8:08 am    Post subject: Reply to: How to define Undefined records in Assembelr
Reply with quote

Hi,

Out of list of 4 causes,

1. I checked DD statements..everything looks good

2. I have fixed this in program setting abend codes..

3. I am following standards of code..as my code comes in sequence

4. Only the thing , i guess

I am only copying my input file to output file. her is the code
Code:
 CA010    DS    0F             
         GET   PULLFILE,PULLREC
         MVC   OUTREC,PULLREC 
         PUT   OUTFILE,OUTREC 
         B     CA010           



Code:
 My file declarationsPULLFILE DCB   MACRF=(GM),                   
               DDNAME=PULLFILE,BLKSIZE=32004,
               DSORG=PS,RECFM=U,             
               EODAD=CA090,                 
*                                           
OUTFILE  DCB   MACRF=(PM),                   
               DDNAME=TESTFILE,BLKSIZE=32004,
               RECFM=U,DSORG=PS       


Please let me know if any information still I have to give.

-Sai
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: Sat Nov 08, 2008 8:17 am    Post subject:
Reply with quote

Hello,

How is pullrec defined? How is outrec defined?

You've used mvc which will not move 32k bytes - it will move 256 max. . . Look at the mvcl (move long) instruction.

It is almost certain that you've "walked on storage".

As i asked before, how much assembler experience do you have? This may not be the time to begin learning assembler just because of this file - it sounds like you want/need to move forward more quickly.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Sat Nov 08, 2008 8:23 am    Post subject:
Reply with quote

Quote:
*** List of Probable 0C4 Causes ***
This is by no means an exhaustive list -- there are other things that can cause a S0C4. Don't just run through these 4 and think you've looked at all possible reasons.

Also, what does your execution JCL look like?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Sat Nov 08, 2008 8:30 am    Post subject:
Reply with quote

Quote:
and JCL DD names are INFILE1 and OUTFILE1

Quote:
DDNAME=PULLFILE

Quote:
DDNAME=TESTFILE


Are we talking about the same program all along or did something suddenly get changed?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Nov 08, 2008 1:02 pm    Post subject: Reply to: How to define Undefined records in Assembelr
Reply with quote

I want to is not enough to make code work...
how the code works depends on how You have worked

looking at the code snippets You posted .......
You did not care to read the manual about undefined record processing
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2D540/2.2.28?SHELF=DGT2BK71&DT=20070427024428
and
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT2D540/2.2.43?SHELF=DGT2BK71&DT=20070427024428

undefined record..... aaarghhhhh!?!?!?
once in a while I will not make any recommendations on proper application design
if Your organization wants to shoot itself in the foot, I will be glad to hand You a loaded gun icon_biggrin.gif
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2019
Location: Silicon Valley

PostPosted: Sat Nov 08, 2008 9:44 pm    Post subject: Reply to: How to define Undefined records in Assembelr
Reply with quote

Quote:
1. I checked DD statements..everything looks good

As Robert pointed out, your DD names are not ok. The JCL ddnames have to match the same ones as used in the DCBNAME=parameter of the DCB statements.

What are the return codes from your OPEN statements?


Quote:
I am only copying my input file to output file

A minor point... You do not need to move the data... just do your PUT from the same buffer.
Code:
 CA010    DS    0F             
         GET   PULLFILE,PULLREC
         PUT   OUTFILE,PULLREC
         B     CA010 
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Sat Nov 08, 2008 11:47 pm    Post subject: Reply to: How to define Undefined records in Assembelr
Reply with quote

the TS did not post anything useful for a good problem determination...

he started by defining the buffer with .... DS 0CL....
continuing with an mvc,
keeping on without retrieving the block lenght from the input DCB,
and again without storing it in the output DCB...
and... confusing/misquoting the ddnames...

I wonder how he can affirm that his code is active

I might be picky, but that' s too much

....why a 32004 blksize,
whenever there is the need to treat Undefined records the best blksize to use is 32760,
or better use the DEVTYPE macro to get the largest blksize supported by the device
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Sun Nov 09, 2008 12:01 am    Post subject:
Reply with quote

I suspect the S0C4 is due to the DS 0CL32004 definition -- who knows what storage is getting wiped out in the read? But that's probably irrelevant since it's not at all clear if we're talking about one program, two programs, or even code that makes sense!
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: Sun Nov 09, 2008 12:46 am    Post subject:
Reply with quote

Hello,

This code is the result of frustration with "the file". After other approaches did not work, assembler is being attempted (while it is being learned).

I suspect we can be more productive if we learn where the file came from and what it contains. Once we know what we're dealing with (rather than the assembler code to read the file) we may be better able to offer suggestions. Once the file is read in assembler, the content may not be usable. . .

Several times i've seen something like this, a file was ftp'ed to the mainframe and it was in some priprietary format (spreadsheet, word, etc) and simply recreating the file to upload solved all of the problems.
Back to top
View user's profile Send private message
sakrish

New User


Joined: 05 Nov 2008
Posts: 21
Location: chennai

PostPosted: Tue Nov 11, 2008 12:50 pm    Post subject: Reply to: How to define Undefined records in Assembelr
Reply with quote

Thanks guys..

My inputfile is created by a assembler program

But I couldnt understand what that program is ? its very complicated and huge program.. I had written only few simple assembler codes still now.

We get the file from upstream application.

the ifle will have 01 record and 99 record commom to all records

Between i have 10 th record to 90th record..we call whole thing as bundle.

We may have 1 or more bundles in a file.

What my requirement is we need to extract each bundle..for which 01 and 99 are common

I have written a report in easytrieve which will show each bundle starts at what line and ends at what line.


can we use DFSORT to extract those records..?
I know we couldnt use DFSORT for RECFM=U files.

Can we convert undefined to FB records and process the records..

My mistake..is My names what i mentioned were wrong..ie just for ur understanding..i typed INFILE and OUTFILE..actually i am using PULLFILE and OUTFILE..thats not a problem

A very speacial thanks to all..
I am sorry if I wasted any ones time by my post.

-Sai
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: Tue Nov 11, 2008 1:17 pm    Post subject:
Reply with quote

Hello,

Quote:
I have written a report in easytrieve which will show each bundle starts at what line and ends at what line.
Is this code using the recfm=u file as input? If the file is undefined, how does the code know what lines are in a bundle?
Back to top
View user's profile Send private message
sakrish

New User


Joined: 05 Nov 2008
Posts: 21
Location: chennai

PostPosted: Tue Nov 11, 2008 1:36 pm    Post subject: Reply to: How to define Undefined records in Assembelr
Reply with quote

I just kept a count of records in the file ..If I encounter 10 th record..i will display count number..and 90th record will display end of bundle count..
so I can know where my bundle starts and where it ends..
Back to top
View user's profile Send private message
sakrish

New User


Joined: 05 Nov 2008
Posts: 21
Location: chennai

PostPosted: Wed Nov 19, 2008 3:14 pm    Post subject: Reply to: How to define Undefined records in Assembelr
Reply with quote

Hi guys,

I did it with Easytrieve of extracting the records from Undefined file

but my input file has
Code:

+----8----+----9----+----0----+----1----
+----F----+----F----+----F----+----F----
+----8----+----9----+----0----+----1----
----------------------------------------
************************** Top of Data *
                                       
                                       
----------------------------------------
  H                                     
44C4444444                             
0080000000                             
----------------------------------------
672521                                 
FFFFFF4444                             
6725210000                             
----------------------------------------


doesnt have any values after 85th column


and my extracted file has

Code:

+----8----+----9----+----0----+----1----+
+----F----+----F----+----F----+----F----+
+----8----+----9----+----0----+----1----+
-----------------------------------------
**************************** Top of Data
                                         
                                         
-----------------------------------------
672521                                   
FFFFFF44444444444444444444444444444444444
67252100000000000000000000000000000000000
-----------------------------------------
1214041172                               
FFFFFFFFFF4444444444444444444444444444444
12140411720000000000000000000000000000000
-----------------------------------------

has value X'40' after 85 th column.

Can some one please help..Is any way to make it blank.

Thanks
Sai
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts VSAM define for large file jerryte JCL & VSAM 9 Wed Oct 05, 2016 1:51 am


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