[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-697965-105":59,"doc-detail-697965-en":130,"doc-similar-697965":161},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","arrays-made-easy-an-introduction-to-arrays-and-array-processing-sugi-30-tutorials","Arrays Made Easy - An Introduction to Arrays and Array Processing - SUGI 30 Tutorials","","Many programmers avoid arrays because they seem daunting, but SAS arrays provide a convenient way to temporarily group related variables inside a data step for consistent processing. After defining an array, programmers can apply the same logic across array elements and simplify many program scenarios. The tutorial reviews why arrays are needed, core concepts and syntax, indexing, one- and multi-dimension arrays, temporary arrays, subscripting modes, sorting, usage guidance, and common errors.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/arrays-made-easy-an-introduction-to-arrays-and-array-processing-sugi-30-tutorials/697965/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/arrays-made-easy-an-introduction-to-arrays-and-array-processing-sugi-30-tutorials/697965.png","ImageObject",300,407,{"name":92,"@type":93},"Finn","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-22","2026-11-12",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"Why do programmers use arrays in SAS?","Question",{"text":112,"@type":113},"Arrays simplify processing by letting related variables be grouped temporarily, enabling repetitive work with less coding. They also support operations like analysis and table lookups within a data step.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How is a SAS array defined?",{"text":117,"@type":113},"A SAS array is defined using the ARRAY statement inside the data step. The array statement provides the array name, the number of elements, element type (including character via $), length, and the list of variables to include.",{"name":119,"@type":110,"acceptedAnswer":120},"What happens if an array is referenced without being defined, or across different data steps?",{"text":121,"@type":113},"If an array is referenced before it is defined, an error occurs. Defining an array in one data step and referencing it in another also causes errors because arrays exist only for the duration of the defining data step.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},697965,1794446535,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":19,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":44,"language":139,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":67,"update_tm":129,"read_time":143,"preview_page_count":19,"preview_urls":144},34359740700684,"https://ap-avatar.wpscdn.com/avatar/1f400023980c374ae676?_k=1777273430885731487","SUGI 30 Tutorials  \nPaper 242-30  \nArrays Made Easy: An Introduction to Arrays and Array Processing  \nSteve First and Teresa Schudrowitz, Systems Seminar Consultants, Inc. , Madison, WI  \nABSTRACT  \nMany programmers often find the thought of using arrays in their programs to be a daunting task, and as a result they often shy away from arrays in their code in favor of better-understood, but more complex solutions. A SAS array is a convenient way of temporarily identifying a group of variables for processing within a data step. Once the array has been defined the programmer is now able to perform the same tasks for a series of related variables, the array elements. Once the basics of array processing are understood arrays are a simple solution to many program scenarios.  \nThroughout this paper we will review the following array topics:  \n1) Why do we need arrays?  \n2) Basic array concepts  \na) Definition  \nb) Elements  \nc) Syntax  \nd) Rules  \n3) Using array indexes  \n4) One dimension arrays  \n5) Multi-dimension arrays  \n6) Temporary arrays  \n7) Explicit vs. implicit subscripting  \n8) Sorting arrays  \n9) When to use arrays  \n10) Common errors and misunderstandings  \nINTRODUCTION  \nMost mathematical and computer languages have some notation for repeating or other related values. These repeated structures are often called a matrix, a vector, a dimension, a table, or in the SAS data step, this structure is called an array. While every memory address in a computer is an array of sorts, the SAS definition is a group of related variables that are already defined in a data step. Some differences between SAS arrays and those of otherlanguages are that SAS array elements don’t need to be contiguous, the same length, or even related at all. All elements must be character or numeric.  \nWHY DO WE NEED ARRAYS?  \nThe use of arrays may allow us to simplify our processing. We can use arrays to help read and analyze repetitive data with a minimum of coding.  \nAn array and a loop can make the program smaller. For example, suppose we have a file where each record contains 24 values with the temperatures for each hour of the day. These temperatures are in Fahrenheit and we need to convert them to 24 Celsius values. Without arrays we need to repeat the same calculation for all 24 temperature variables:  \ndata;  \ninput etc .  \ncelsius_temp1 = 5/9(temp1 – 32);  \ncelsius_temp2 = 5/9(temp2 – 32);  \n. . .  \ncelsius_temp24 = 5/9(temp24 – 32);  \nrun;  \nSUGI 30 Tutorials  \nAn alternative is to define arrays and use a loop to process the calculation for all variables:  \ndata;  \ninput etc .  \narray temperature_array {24} temp1-temp24;  \narray celsius_array {24} celsius_temp1-celsius_temp24;  \ndo i = 1 to 24;  \ncelsius_array{i} = 5/9(temperature_array{i} – 32);  \nend;  \nrun;  \nWhile in this example there are only 24 elements in each array, it would work just as well with hundreds of elements. In addition to simplifying the calculations, by defining arrays for the temperature values we could also have used them in the input statement to simplify the input process. It should also be noted, while TEMP1 is equivalent to the first element, TEMP2 to the second etc. , the variables do not need to be named consecutively. The array would work just as well with non-consecutive variable names.  \narray sample_array {5} x a i r d;  \nIn this example, the variable x is equivalent to the first element, a to the second etc.  \nArrays may also be used to provide table lookups. For instance, we have different percentage rates that will be applied to a representative’s sales amounts to determine their commission. The percentage amount may be stored within an array structure, and then the array could provide a location to look up the appropriate percentage for inclusion in the commission calculation.  \nBASIC ARRAY CONCEPTS  \nArrays within SAS are different than arrays in other languages. SAS arrays are another way to temporarily group and refer to SAS variables. A SAS array is not a","cbCaif0dvjIDnYHM","https://ap.wps.com/l/cbCaif0dvjIDnYHM","pdf",44377,"English","# Arrays Made Easy: An Introduction to Arrays and Array Processing\n## Abstract\n## Introduction\n## Why Do We Need Arrays?\n## Basic Array Concepts\n## Array Statement\n## Using Array Indexes\n## One Dimension Arrays\n## Multi-dimension Arrays\n## Temporary Arrays\n## Explicit vs. Implicit Subscribing\n## Sorting Arrays\n## When to Use Arrays\n## Common Errors and Misunderstandings","[{\"question\":\"Why do programmers use arrays in SAS?\",\"answer\":\"Arrays simplify processing by letting related variables be grouped temporarily, enabling repetitive work with less coding. They also support operations like analysis and table lookups within a data step.\"},{\"question\":\"How is a SAS array defined?\",\"answer\":\"A SAS array is defined using the ARRAY statement inside the data step. The array statement provides the array name, the number of elements, element type (including character via $), length, and the list of variables to include.\"},{\"question\":\"What happens if an array is referenced without being defined, or across different data steps?\",\"answer\":\"If an array is referenced before it is defined, an error occurs. Defining an array in one data step and referencing it in another also causes errors because arrays exist only for the duration of the defining data step.\"}]","Arrays Made Easy - An Introduction to Arrays and Array Processing - SUGI 30 Tutorials | PDF",23,[145,149,153,157],{"page_no":8,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/6a759f93ac9a557c7aad53ee21491422.webp",983,1272,{"page_no":14,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/ee7e8205719c259177b26dd9678aa080.webp",982,1270,{"page_no":81,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/9b87b43d5a5ba2e305574f40cfeb8b9b.webp",981,1269,{"page_no":19,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/1fbc2add1de7f86dea12b30d1e148882.webp",980,1268,{"list":162,"token":66},[163,169,175,182,188,193,199,204,210,216],{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":19,"category_name":30,"create_tm":168},693583,"An Introduction to SQL in SAS®","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230005517124/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=RLLdjAh3AWyu1YB92eR953xQYTk%3D","an-introduction-to-sql-in-sas",1794290693,{"doc_id":170,"doc_title":171,"file_type":137,"home_preview_img_url":172,"slug":173,"view_count":34,"category_name":30,"create_tm":174},685788,"Python Arrays - Learn How to Create, Access, and Modify Lists","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999694760/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=ODwTfq0joGPJtZyVe5yTwfwWpQQ%3D","python-arrays-learn-how-to-create-access-and-modify-lists",1794018478,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":180,"category_name":30,"create_tm":181},290696,"The Little SAS Book - Fifth Edition - Contents","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229903739494/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=vpR058aKvjdQ%2BLzUBrkbC47WOFg%3D","the-little-sas-book-fifth-edition-contents",15,1789642381,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":19,"category_name":30,"create_tm":187},685795,"Tutorial - Arrays and ArrayList - Introduction and Examples","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000212503/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=iTysexyK5C6fCaNB0k1FkhFmJf8%3D","tutorial-arrays-and-arraylist-introduction-and-examples",1794018675,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":81,"category_name":30,"create_tm":174},685787,"Arrays - Java Arrays vs Python Lists - Learn how to declare and use arrays in Java","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000208980/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=WeUujjrxaidZHTKPjBpLCeDdFi8%3D","arrays-java-arrays-vs-python-lists-learn-how-to-declare-and-use-arrays-in-java",{"doc_id":194,"doc_title":195,"file_type":137,"home_preview_img_url":196,"slug":197,"view_count":19,"category_name":30,"create_tm":198},685809,"NumPy and Image Processing Primer Discussion - 1","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000213275/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=z7CSZ8FeW9y3Z6VvDHt4N1A6ioE%3D","numpy-and-image-processing-primer-discussion-1",1794018719,{"doc_id":200,"doc_title":201,"file_type":137,"home_preview_img_url":202,"slug":203,"view_count":39,"category_name":30,"create_tm":198},685810,"Lecture 3 - NumPy basics - Arrays and Vectorized Computation","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000213289/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=sfLrGpeOZ9gHtX2rc4eydjOYQmQ%3D","lecture-3-numpy-basics-arrays-and-vectorized-computation",{"doc_id":205,"doc_title":206,"file_type":137,"home_preview_img_url":207,"slug":208,"view_count":44,"category_name":30,"create_tm":209},326246,"Array Formulae in Excel - How to Use DSUM and Avoid Array Crawl","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229909039523/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=ZlCuVtp3CD1A2pjvQUY3%2Fv%2F5Pk8%3D","array-formulae-in-excel-how-to-use-dsum-and-avoid-array-crawl",1789973752,{"doc_id":211,"doc_title":212,"file_type":137,"home_preview_img_url":213,"slug":214,"view_count":29,"category_name":30,"create_tm":215},685634,"Python Collections - Arrays - List and Function","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999084045/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=RebxWqX0pliAj8O24xHhjwuljkQ%3D","python-collections-arrays-list-and-function",1794016101,{"doc_id":217,"doc_title":218,"file_type":137,"home_preview_img_url":219,"slug":220,"view_count":221,"category_name":30,"create_tm":222},347077,"Thinking in Java - 4th Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229910997714/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110679&Signature=nOv7%2BgmTHE%2F%2BIW9%2Fgv%2B3WgtvAEE%3D","thinking-in-java-4th-edition",18,1790065169]