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
 

 

query - Regarding field of diff types

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Fri Oct 30, 2009 11:06 am    Post subject: query - Regarding field of diff types
Reply with quote

Hi ,

Is it possible to store the field of diff types such as alphanumeric , COMP value , numeric , and field of different lengths into a single working storage variable and string each and every time

For eg:

My first field content will be numeric of length 11
My second field content will be alphanumeric of length 5

My third field content will be packed decimal of length 4


So each and evry time while running I want to string the field content along with other variables,,

Whether it is possible ?
R can anyone please help me in suggesting some other alternatives and explain with an example
Back to top
View user's profile Send private message

Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Oct 30, 2009 11:23 am    Post subject:
Reply with quote

Hi Gay,

Unless i misunderstood you... I guess whatever you have asked is pretty basic stuff in COBOL.. icon_cool.gif

Quote:
Is it possible to store the field of diff types such as alphanumeric , COMP value , numeric , and field of different lengths into a single working storage variable
Yes... its possible

Quote:
I want to string the field content along with other variables
Could you plz explain.. probably with some sample data.. icon_razz.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Oct 30, 2009 3:29 pm    Post subject:
Reply with quote

As Binop has stated, yes this can be done.

a hint - STRING (and UNSTRING)
[as the command name implies]
only works on X-type and display.
so, if your output result is expected to contain the fields as COMP, COMP-3, etc.
you need to redefine each field as x-type for the STRING command to compile.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm


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